You'd still fall foul of dodgy file with special characters, surely?

It'd be far better to do find . -name "*.meta" -exec foobar {} \;   and 
know that you're a) not going to suffer a blow up due to too many files, 
and b) know it's not going to get screwed up by someone or something 
deciding a space or any other special character that'd need escaped is 
in the list.

Paul

On 12/9/2010 7:33 PM, Brad Knowles wrote:
> On Dec 9, 2010, at 5:33 PM, Randal L. Schwartz wrote:
>
>> Just use the shell:
>>
>> for i in *.meta; do echo "something with $i"; done
> Safer, but I believe that still blows up if there are too many files that 
> match the expression.
>
> IMO, it's better to do something like:
>
>       cd $directory
>       ls -1 | grep '\.meta$'>  $tmpfile
>
> And then process the $tmpfile line-by-line, using whatever method you prefer.
>
> --
> Brad Knowles<[email protected]>
> LinkedIn Profile:<http://tinyurl.com/y8kpxu>
>
> _______________________________________________
> Discuss mailing list
> [email protected]
> https://lists.lopsa.org/cgi-bin/mailman/listinfo/discuss
> This list provided by the League of Professional System Administrators
>   http://lopsa.org/
>

_______________________________________________
Discuss mailing list
[email protected]
https://lists.lopsa.org/cgi-bin/mailman/listinfo/discuss
This list provided by the League of Professional System Administrators
 http://lopsa.org/

Reply via email to