is this what you're looking for?

- erik

#!/bin/rc
# which

if (~ $#* 0){
echo 'usage: which file...'
exit 'usage'
}

for (i in `{ns | awk '$NF == "/bin" {print $(NF -1)}'})
if (test -f $i/$1)
echo $i/$1

On Thu Jan 11 11:49:14 EST 2007, steve@quintile.net wrote:
> I want to discover where a file has come from, I understand that
> it will probably lead back to a /srv descriptor or a network connection
> but that is good enough. I need to walk back up the cd and the list of binds
> in the output of ns(1).
>
> I think this needs care to really get it right, so, has anyone got some
> C or rc that does this or shall I just fumble around until I sort it out
> for myself :-)
>
> Thanks guys,
>
> -Steve