Solved

Typeset/Ddeclare: Is this a Unix/Linux problem?

Posted on 2006-06-13
2
337 Views
Last Modified: 2010-04-21
We just switched to a new server (Linux) from a UNIX machine.

The code below is a script  to convert upper to lower case file names and it seemed to work fine on the 'old' server.

I'm getting an error:  "line 2: typeset: -l: invalid option"

When I checked Linux indicated "typeset" is an obsolete command.

Is this not working because of using "typeset" or some other reason?

I'm also getting: "mv: cannot stat ...... : No such file or directory."

Could this all be part of the same problem?

Thanks-
*********************************************
typeset -l NEWNAME=LOWER
ls -1 * > mylist
for i in `cat mylist`
  do
  #NEWNAME=$i
  NEWNAME=`echo $i |  tr '[A-Z]' '[a-z]'`
  mv $i ${NEWNAME}
done
0
Comment
Question by:tmccar10
2 Comments
 
LVL 29

Accepted Solution

by:
MikeOM_DBA earned 75 total points
ID: 16894241

typeset command in Linux does not have the '-l' option, your script should work.

Your problem may be the * in 'ls -1 *' which will generate empty lines and directory names, better try this:

find . -type f >mylist





0
 

Author Comment

by:tmccar10
ID: 16895137
Thanks, exactly what I needed.

Nice to know the Linux folks are as helpful as the Unix folks...I generally need all the help I can get!

Thanks again
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video discusses moving either the default database or any database to a new volume.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now