Solved

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

Posted on 2006-06-13
2
338 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

867 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

21 Experts available now in Live!

Get 1:1 Help Now