[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: UPPER to lowercase.

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 *
        mv $x `echo $x | tr 'A-Z' 'a-z'`

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

Attachment: pgpoQfkc2exKp.pgp
Description: PGP signature

Reply to: