[SGVLUG] bash "for" with spaces [was: Re: Thanks for bash -c puzzle]

Rod Morison rod at morison.biz
Mon Apr 19 20:04:26 PDT 2010


foo "$f"

On 4/19/2010 7:47 PM, John E. Kreznar wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> While the subject of bash quoting is hot, does anyone know a simple
> idiom to replace
>
>     for f in * ; do foo $f ; done
>
> in cases where the directory has files whose names contain spaces?
>
> - -- 
>   John E. Kreznar jek at ininx.com 9F1148454619A5F08550 705961A47CC541AFEF13
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
> Comment: Processed by Mailcrypt 3.5.8+<http://mailcrypt.sourceforge.net/>
>
> iEYEARECAAYFAkvNFXcACgkQYaR8xUGv7xOuiwCfbqTwISn8sBwtFGdOomEbCXnl
> E/UAnjiQdUHGQ8Z3H7pED+xf/lVS0sLw
> =8IZB
> -----END PGP SIGNATURE-----
>
>    


More information about the SGVLUG mailing list