From e52b92f00f85f85166910316da173c137ee175d2 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Wed, 1 Dec 2010 10:56:14 -0300 Subject: [PATCH] usrp/doall: usage and allow passing of arguments to evscan as well Examples: doall 'run/*' # no arguments doall -o foo.png 'run/*' # arguments for plscan doall -a 1 -- -o foo.png 'run/*' # arguments for evscan and plscan - usrp/doall: added usage() - usrp/doall: arguments before -- are passed to evscan --- usrp/doall | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/usrp/doall b/usrp/doall index b0037a9..b6be210 100755 --- a/usrp/doall +++ b/usrp/doall @@ -1,11 +1,26 @@ #!/bin/bash -x + +usage() +{ + echo "usage: $0 [evscan-opt ... --] [plscan-opt ...] 'file-glob'" 1>&2 + exit 1 +} + + +[ "$1" ] || usage +evscan_opts= opts= while [ "$2" ]; do - opts="$opts $1" + if [ "$1" = -- ]; then + evscan_opts=$opts + opts= + else + opts="$opts $1" + fi shift done a= for n in $1; do - a="$a `basename $n`=<(./evscan $n)" + a="$a `basename $n`=<(./evscan $evscan_opts $n)" done eval ./plscan $opts $a