?
Solved

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

Posted on 2006-06-13
2
Medium Priority
?
386 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 300 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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

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 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…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

764 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