Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

610 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