#!/bin/sh
#
# get uudecode items from inputlist
# -o is name of output file will be appended to
# - is from standard input
#
# all boils down to reading standard input anyway
# and writing standard output
#
CMD=$0 ;
if [ "$*". = "." ]
then
exec $CMD -
fi
argc=0
for a in $*
do
if [ ${next-0} -eq 1 ]
then
out=$a;
next=2;
continue;
fi
case $a in
-o) next=`expr ${next-0} + 1 `;;
*) if [ -r $a ]
then
args="${args}${args+"" ""}$a"
else
echo $CMD: "Can't read $a" 1>&2
status=1;
fi
argc=`expr ${argc-0} + 1`
;;
esac
done
if [ ${out-.} != "." ]
then
$CMD ${args-} >>$out
exit $?
fi
if [ ${argc-0} -ne 0 -a "${args-.}" = "." ]
then
exit $status
fi