On Fri, 24 Aug 2007 09:53:19 +0800
Charlie Bond <[log in to unmask]> wrote:
The following sequence fails with 'spacey' filenames, and uses only core
unix commands (and I like using find/xargs - maybe there is something
more modern however).
find . -name "*.pdb" | xargs grep -c ^ATOM
The zshell has zargs, which does the right thing:
zsh-% find . -name "*.pdb" | xargs grep -c ^ATOM
2goz.pdb:0
grep: ./2goz: No such file or directory
grep: space.pdb: No such file or directory
./2goz.pdb:0
zsh-% autoload -U zargs
zsh-% find . -name "*.pdb" | zargs grep -c ^ATOM
grep -c 2goz space.pdb 2goz.pdb
zsh-%
|