[SWLUG] Find And Replace.

Huw Lynes lynesh at Cardiff.ac.uk
Thu Jan 7 15:32:12 UTC 2010


On Thu, 2010-01-07 at 14:57 +0000, Andrew Jenkins wrote:
> Marcus.Davage at googlemail.com wrote:
> > Try "s/-/\ -\ /"
> > (escape characters before the spaces.
> > M
> Ah, I was just trying that before your post. No, sorry
> exactly the same result as before (Amazing.mp3 is
> not a directory etc.)

I think the script is splitting filenames on spaces. You need

$IFS='\n'

to tell Bash to only split on newlines. Put that somewhere at the top of
the script.

Thanks,
Huw

-- 
Huw Lynes                       | Advanced Research Computing
HEC Sysadmin                    | Cardiff University
                                | Redwood Building, 
Tel: +44 (0) 29208 70626        | King Edward VII Avenue, CF10 3NB





More information about the Swlug mailing list