Re: bash: for to, reading escaped spaces in filenames

2003-07-13 Thread Fraser Campbell
On July 13, 2003 06:05 am, David selby wrote: > I need to scan a directory for the file names contained in it. > > for _scantox in $(ls $_tox); do > . > done If I expect to find files with spaces I always use some variant of this: ls /somewhere | while read file; do something "$file" don

Re: bash: for to, reading escaped spaces in filenames

2003-07-13 Thread David selby
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 c

Re: bash: for to, reading escaped spaces in filenames

2003-07-13 Thread David selby
Steve Lamb wrote: On Sun, 13 Jul 2003 11:05:41 +0100 David selby <[EMAIL PROTECTED]> wrote: I need to scan a directory for the file names contained in it. for _scantox in $(ls $_tox); do . done Why use ls? Use the shell's globbing. IE, poor man's ls: bash-2.05b$ echo * De

Re: bash: for to, reading escaped spaces in filenames

2003-07-13 Thread Jeff Schaller
> 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 manipulati

Re: bash: for to, reading escaped spaces in filenames

2003-07-13 Thread Shawn Lamson
On Sun, July 13 at 11:05 AM EDT David selby <[EMAIL PROTECTED]> wrote: >I need to scan a directory for the file names contained in it. > >for _scantox in $(ls $_tox); do >. >done > >works just file with _scantox holding the file name, However some of the >file names are in the form of >342345

bash: for to, reading escaped spaces in filenames

2003-07-13 Thread David selby
Hello, I need to scan a directory for the file names contained in it. for _scantox in $(ls $_tox); do . done works just file with _scantox holding the file name, 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. I