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

Re: UPPER to lowercase.

On Sunday, 02 April 2000 at 17:13, 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;
> 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

two things, I think. First, you need backticks but you are using
single quotes. Second, I think you need a space between the two ranges
in tr:

for x in *; do mv $x `echo $x|tr [A-Z] [a-z]`; done;


Reply to: