[CentOS] Shell Script Pointers?
Stuart Jansen
sjansen at gurulabs.comWed May 20 05:21:25 UTC 2009
- Previous message: [CentOS] Shell Script Pointers?
- Next message: [CentOS] [Fwd: Re: How to generate a .template and .jigdo from an iso image?]
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Tue, 2009-05-19 at 22:06 -0400, Eric Sisolak wrote: > Also you could try > > for FOLDER in `find /usr/local/squidGuard/db -maxdepth 1 -type d`; do This is a classic mistake. It has two problems: 1) The list of files created by the embedded find can exceed the maximum command length. 2) Directories with spaces in their name will be split by the tokenizer, resulting in $FOLDER containing invalid or dangerous paths. > instead of > find /usr/local/squidGuard/db -maxdepth 1 -type d | while read FOLDER; do This is the correct way to combine a shell loop with a program that creates a list of files.
- Previous message: [CentOS] Shell Script Pointers?
- Next message: [CentOS] [Fwd: Re: How to generate a .template and .jigdo from an iso image?]
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the CentOS mailing list