Kripa Sundar:
> On my system, whereis(1) doesn't do what I want it to do,
> which is search my $PATH. The following one-liner does this:
>
> || % perl -lwe '$,=" ";for my $x(@ARGV){print "$x:", \
> || map {-e "$_/$x" ? "$_/$x" : ()} split /:/,$ENV{PATH}}' ls cat
Not portable!
% perl -MFile::Spec::Functions -wle 'for $x (@ARGV) { map { print "$x: $y"
if -x ($y=catfile($_,$x))} path() }' cat ls
--
Grr... don't get me started on Wagner. The man couldn't resolve a
dominant seventh to a tonic with two musical dictionaries open to the
word "resolution", and a copy of anything by Muddy Waters.
- Eric the Read, in the monastery.