Path: utzoo!utgpu!cs.utexas.edu!uunet!convex!news From: tchrist@convex.COM (Tom Christiansen) Newsgroups: alt.sources.d Subject: Re: Multiple executables in path Message-ID: <1991Jan25.081840.12731@convex.com> Date: 25 Jan 91 08:18:40 GMT References: <17501:Jan2414:21:3991@kramden.acf.nyu.edu> <5657@idunno.Princeton.EDU> <21227:Jan2422:43:3791@kramden.acf.nyu.edu> Sender: news@convex.com (news access account) Reply-To: tchrist@convex.COM (Tom Christiansen) Organization: CONVEX Software Development, Richardson, TX Lines: 46 Nntp-Posting-Host: pixel.convex.com From the keyboard of brnstnd@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 )