Jeff Schaller wrote:

David selby <[EMAIL PROTECTED]> wrote:


I need to scan a directory for the file names contained in it.





However some of the file names are in the form of
342345\ remind\ for\ apt-get\ update

ie they have escaped spaces in the name.





Without resorting to complex string manipulation & cutting, is there a
neat way to do this ?



I missed the start of this thread (just joined the list), but does this work for you?

ls -1 *pattern* | while read file; do echo $file; done

-jeff


Many thanks for your input, finally used a globbing solution by steve,

for var in ..../*; do
....
done

Though I will try your suggestion, I had not thought of this either !

Dave



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Reply via email to