mikshaw
Group: Members
Posts: 4856
Joined: July 2004 |
|
Posted: April 06 2006,02:49 |
|
make sure ls is in backticks (`ls`), not quotes ('ls'). ADDED for great help: Using backticks will result in the output of the ls command being used in the script. For example, if the output of ls was "foo.txt bar.txt", the script would behave like this: for i in foo.txt bar.txt; do <commands> done The backticks are also used in this script to retrieve a new filename for your files (echos the original and then pipes that to tr, which replaces all lowercase characters with uppercase ones). In bash, using $(ls) achieves the same thing as `ls`.
You can replace the command altogether by using a wildcard rather than ls: for i in *;do mv $i `echo $i | tr 'a-z' 'A-Z'`;done
-------------- http://www.tldp.org/LDP/intro-linux/html/index.html
|