[lug] bash scripting question

Kenneth D. Weinert kenw at quarter-flash.com
Fri Nov 18 11:23:54 MST 2005


for i in *; do
  command "$i"| othercommand
done

On Fri, November 18, 2005 08:45, 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.
>
>
>
> Hugh
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: lug.boulder.co.us port=6667 channel=#colug
>


-- 
Ken Weinert  Quarterflash Design Group  http://quarter-flash.com

>From a bit to a few hundred megabytes, from a microsecond to half an
hour of computing, [computing] confronts us with the completely
baffling ratio [of scales] of 10**9.

The programmer is in the unique position that his is the only discipline 
and profession in which such a gigantic ratio, which totally baffles the
imagination, has to be bridged in a single technology. He has to be able
to think in terms of conceptual heirarchies that are much deeper than a
single mind ever needed to face before. - Edsger Dijkstra





More information about the LUG mailing list