home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Unix System Administration Handbook 1997 October
/
usah_oct97.iso
/
news
/
cnews.tar
/
conf
/
inall
< prev
next >
Wrap
Text File
|
1994-08-17
|
382b
|
32 lines
#! /bin/sh
# run a command in each of several directories
cmd="$1"
shift
case $# in
0) echo "Usage: $0 cmd dir ..." >&2 ; exit 2 ;;
esac
for d
do
if test ! -d $d
then
echo "$0: \`$d' is not a directory" >&2
exit 1
fi
done
here=`pwd`
for d
do
echo "==== $d:" >&2
cd $here/$d
eval $cmd
if test $? -ne 0
then
echo "*** $0 terminated" >&2
exit 1
fi
echo
done
exit 0