On Sun, Apr 02, 2000 at 05:13:33PM +0200, Hans wrote:
> I'm trying to get this bash script working which converts filenames from
> UPPER to lowercase.
>
> for x in *; do mv $x 'echo $x|tr [A-Z][a-z]'; done;
wrong kind of quotes:
#! /bin/sh
for x in *
do
mv $x `echo $x | tr 'A-Z' 'a-z'`
done
is what i have used in the past.
the single ' quote causes the EXACT string to be passed to mv, no $x
variables are expanded etc.
> It comes back with 'when moving multiple files, last argument must be a
> directory.' I thought this was a loop, so how come it moves multiple files?
> Any ideas how to get this working? tnx --hans
>
>
> --
> Unsubscribe? mail -s unsubscribe debian-user-request@lists.debian.org < /dev/null
>
--
Ethan Benson
http://www.alaska.net/~erbenson/
Attachment:
pgpbA9vXtBSzQ.pgp
Description: PGP signature