Subject: Re: =?ISO-8859-1?Q?some=20help=20with=20a...=20shellscript=3F=BF?=
To: Jojo <info@thrill-inc.com>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: port-macppc
Date: 08/03/2001 10:27:19
> #!/bin/bash
> if [ $# != 0 ]; then
>   x=$1; shift; for i in $@; do x="$x $i"; done
>   exec /usr/bin/find $ROOTDIR -follow -name "$x" -printf "\r%P"
> else
>   exec /usr/bin/find $ROOTDIR -follow -printf "\r%P"
> fi

> am i correct that this is for the bash shell?

Yes.  Or at least, it's for /bin/bash, which presumably is supposed to
be bash.  However, I don't see anything on a quick read that wouldn't
work with our sh.

However, the shell is not the only projblem: it also depends on
/usr/bin/find having a -printf option, which ours doesn't, at least not
as of the version I have handy (which admittedly is a bit over a year
old).

> i was wondering if anyone here is up for the task of making this a
> script for tcsh

tcsh isn't installed by default either, is it? :-)  Looks to me as
though just changing /bin/bash to /bin/sh in the #! line should make it
work, as far as the shell is concerned.  You will still have problems
with find, though; there's -printf, as I mentioned above, and it also
appears to expect -name to take multiple space-sseparated arguments.
It also does so in a bizarre way; I don't understand why it doesn't
just

if [ $# != 0 ]; then
  exec /usr/bin/find $ROOTDIR -follow -name "$*" -printf "\r%P"
else

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B