9 filterexec - Echo those arguments with which the given command returns zero.
13 filterexec I<COMMAND> [I<ARGS>] -- I<DATA-1> [I<DATA-2> [... I<DATA-n>]]
17 Prints each I<DATA> (1 per line) only if command I<COMMAND ARGS DATA> exits
18 succesfully, ie. with zero exit status.
20 If you want to evaluate not command line arguments, but data read on STDIN,
21 then combine filterexec(1) with foreach(1).
25 filterexec test -d -- $(ls)
27 Shows only the directories.
28 The shell's tokenization may wrongly splits up file names containing space.
29 Perhaps set C<IFS> to newline only.
31 ls -1 | foreach filterexec test -d --
33 Same, but file names are supplied 1-by-1, not all at once,
34 hence filterexec(1) is invoked multiple times.
40 # text editor syntax highlighter fix: '
68 for item
in "${items[@]}"
70 if "${command[@]}" "$item"