Hi,

now it works, but because of the '*'.

now i want to remove the leading abc from all files in my directory.
i tried this:

for i in *; do mv $i `echo $i | sed s/abc//`; done

but it doesn't do that.
i always get the error, that the last arguement must be a directory!
I guess, the reason are the white spaces in the names.
perhaps the expression `echo $i | sed s/abc//` also have to be set in ''
or so, but it doesn't work this way.

please help

regards,
hampel



Am Son, 2003-03-16 um 16.20 schrieb Rus Foster:
> On Sun, 16 Mar 2003, Kleiner Hampel wrote:
> 
> > Hi,
> >
> > i have a directory with some files with spaces in the name:
> >
> > abc 1.mp3
> > abc 2.mp3
> > abc 3 track 2.mp3
> >
> > For my shell script i have to begin so:
> >
> > for i in `ls`; do echo $i; done
> >
> 
> Try
> 
> cd /tmp/foo
> for i in * ; do echo "$i" ; done
> 
> You need the quotes
> 
> Rgds
> 
> Rus
> --
> http://www.65535.net | MSN: [EMAIL PROTECTED] | e: [EMAIL PROTECTED]
>                   "More bits for your bite"
>         Lifetime FreeBSD + Linux Hosting and Shell Accounts
>              Please respect RFC1855 and don't top post




-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to