Unfortunately this then treats the entire 'ls' as a single element and prints that 
when I print FILE.

ie the whole of the ls output is printed between the >xxx< quotes.

Matt

At Friday, 26/10/2001 03:24 PM (+1000), George Vieira wrote:
>try this
>
>for FILE in "`ls -1`"; do echo ">$FILE<"; done
>
>confirm it displays what you want and then change the ECHO command to do
>what you want..
>
>BUT remember to use quotes "" around the $FILE....      
>
>
>
>thanks,
>George Vieira
>Network Engineer
>Citadel Computer Systems P/L
>
>
>
>-----Original Message-----
>From: Matt Hyne [mailto:[EMAIL PROTECTED]]
>Sent: Friday, October 26, 2001 3:16 PM
>To: [EMAIL PROTECTED]
>Subject: [SLUG] Filenames with spaces - and using a shell script.
>
>
>
>I am trying the write a little script to convert some MS Word files to HTML,
>however some of the word files contain spaces in their name.
>
>Hense, when I use the couple of lines below, it treats the space as a
>delimiting character and chops up the filename.
>
>Anyone know how to get around this without renaming all the files (some
>350).
>
>Ie
>
>for FILE in `ls`; do
>        echo "Converting $FILE..."
>done
>
>Converting xxx...
>Converting yyy...
>Converting zzz.doc...
>
>[root@panda MSDS]#  ls -l xxx\ yyy\ zzz.doc 
>-rwxr-xr-x    1 root     root            50 Oct 26 14:40 xxx yyy zzz.doc
>[root@panda MSDS]# 
>
>Matt
>
>
>-- 
>SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
>More Info: http://lists.slug.org.au/listinfo/slug



-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to