On Sat, 2006-05-20 at 14:55 +1000, Richard Neal wrote:
> give you a clue
> 
> the shell ignores spaces unless you put "qoutes" around the variable
> ie "$B" will pass the spaces to the shell $B wont.
> 

I've tried a few variations on that, but none of them seem to work :(

> On Sat, 2006-05-20 at 14:52 +1000, david wrote: 
> > The scrip works as long as there are no blanks.... unfortunately there
> > are lots of blanks in both directories and filenames. Can anyone tell me
> > what i should be doing?
> > 
> > #!/bin/bash
> > # takes the first 3 chars of each directory and
> > # prepends it to the file names in that directory.
> > 
> > #cd /home/david/Desktop/musicbyalbum
> > cd /home/david/test
> > for x in $(ls)
> > do
> >         y=$(echo $x | cut -c -3)
> >         for z in $(ls $x)
> >         do
> >                 mv $x/$z $x/$y$z
> >         done
> > done
> > 
> > 
> Regards
> 
> Richard Neal
> 
> Real Men don't make backups.  They upload it via ftp and let the world
> mirror it.
>         -- Linus Torvalds
> 
> 
> 

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to