Multiple executables in path

Tom Christiansen tchrist at convex.COM
Fri Jan 25 19:18:40 AEST 1991


>From the keyboard of brnstnd at kramden.acf.nyu.edu (Dan Bernstein):
:> However, with Tom's, the difference is:
:> < printf "$path\n" if -x ($path="$dir/$file");
:> > printf "$dir/$file\n";
:
:Yeah, so? That's more characters changed than in my version.
:Intuitively, though, using $path is analogous to the middle stage with
:ls instead of echo, and the -x test is analogous to the * extraction.

No, it's not in the least bit intuitive.   No series of filters
strung together like that using 4 regexps and multiple evaluation
will ever be as easy to understand as my solution.  On that I stand.

:> >  ls -dFL `echo "$PATH" | tr : '\012' | sed -e 's:$:/!:1': -e 's:^:/.[.]:'`\
:> >    | sed -n -e 's:/\.\./:/:g' -e 's/*$//p' | head -1

It's also slower than sin.

:No shit. Standard implementations of commonly used programs are written
:in C, because the world doesn't want its computers to be twice as slow.

So why didn't you post a solution in C then?  

The perl solution is much faster than your grody hack, if you're honestly
concerned about speed.   I'm also concerned about complexity.

It doesn't make one bit of difference whether a command executed as
infrequently as which takes .03 seconds instead of .06 seconds.

:You and Tom are coming across as so lazy that you'd rather waste
:thousands of dollars of money around the world arguing with facts than
:spending the two minutes it would take you to figure things out on your
:own. Any competent shell programmer can use filters, and I'm not going
:to teach you tricks that you can easily figure out for yourself.

Just what is this claptrap?  I can't make any sense of it.  It has
no relevance on anything going on here.  Dan's just being insulting
and attacking wildly again.  He attempts to persuade by bashing 
you on the head and lobbing insults.  What a wonderful world it
would be if everyone would do this.

--tom
--
"Hey, did you hear Stallman has replaced /vmunix with /vmunix.el?  Now
 he can finally have the whole O/S built-in to his editor like he
 always wanted!" --me (Tom Christiansen <tchrist at convex.com>)



More information about the Alt.sources.d mailing list