Solved

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

Posted on 2006-06-13
2
361 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.
Suggested Courses

734 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