[lug] bash scripting question

Hugh Brown hugh at math.byu.edu
Fri Nov 18 11:07:47 MST 2005



On Fri, 18 Nov 2005, D. Frye wrote:

> On Fri, Nov 18, 2005 at 08:45:53AM -0700, Hugh Brown wrote:
> } I've had this problem a few times and haven't found a quick way to get
> } around it.  I often do per file operations at the bash prompt with
> } something like this:
> }
> } for i in `ls`; do
> } command $i| othercommand
> } done
> }
> } The problem is that if the files have spaces in them, then things break.
> }
> } Is there some bash'ism that would allow me to get this to work.
> }
>
> I've been successful in using this for some of my scripts:
>
> cat $FILE | while read line
> do
> ...
> done
>
> HTH,
>
> dafr
>

I was hoping to avoid generating an extra file before running the script.
I may be hoping in vain.

Hugh



More information about the LUG mailing list