[PLUG] find | while read
Jeme A Brelin
jeme at brelin.net
Sat Apr 12 18:25:33 UTC 2008
On Sat, 12 Apr 2008, Stuart Jansen wrote:
> Ever since I was taught "while read" as a method to avoid whitespace
> problems, it has been one of my favorite shell scripting tricks.
> Unfortunately, while working on a git script yesterday, I discovered an
> instance where it doesn't work. Specifically, Bash is leaking the output
> of find to the screen and horking stdin.
Um, if you're processing find output, wouldn't you be better off using the
-exec option rather than a pipe? That should avoid problems with the
filename parsing.
J.
More information about the PLUG
mailing list