Thanks guys. I indeed got the quotes wrong and also the space in between
the two arguments. This worked fine:
for x in *; do mv $x `echo $x | tr [A-Z] [a-z]`; done
Another lesson learnt: watch `em quotes. Using mmv is fine, but my purpose
is to learn some plain shell scripting. I'm slowly working
Hans <[EMAIL PROTECTED]> 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, s
Hans writes:
> for x in *; do mv $x 'echo $x|tr [A-Z][a-z]'; done;
> ...
> Any ideas how to get this working?
Use the right kind of single quotes and seperate the arguments to tr with a
space.
--
John Hasler
[EMAIL PROTECTED] (John Hasler)
Dancing Horse Hill
Elmwood, WI
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'`
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 thou
On Sun, Apr 02, 2000 at 17:13:33 +0200, Hans wrote:
> for x in *; do mv $x 'echo $x|tr [A-Z][a-z]'; done;
Use
for x in *; do mv $x `echo $x | tr '[A-Z][a-z]'`; done
Note the backticks and the quoting of the square brackets (to prevent them
from being interpreted by the shell as globbing p
6 matches
Mail list logo