Path: utzoo!utgpu!cs.utexas.edu!convex!news From: tchrist@convex.COM (Tom Christiansen) Newsgroups: alt.sources.d Subject: Re: Multiple executables in path (Was: NON-SOURCE POSTINGS CONSIDERED HARMFUL!) Message-ID: <1991Jan25.080151.11595@convex.com> Date: 25 Jan 91 08:01:51 GMT References: <8833@star.cs.vu.nl> <5648@idunno.Princeton.EDU> <17501:Jan2414:21:3991@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: 26 Nntp-Posting-Host: pixel.convex.com From the keyboard of brnstnd@kramden.acf.nyu.edu (Dan Bernstein): :Ya want other behaviors? Fine, ya get other behaviors. These all use the :same strategy as the original. [ many nice pipe examples that no novice will ever decipher. ] :> But Tom's solution can easily be changed to have either behavior. : :So what? So can any reasonable solution. And your solution, Dan, has not yet been proven to be such. Leave the programming langauge at sh if it will eliminate an irrevlant complaint of yours. The principal point is that there is a straightforward algorithm employed here that a relatively recently initiated unix user can easily read and understand. To say "for each dir in path, print the pathname if there is an exececutable file of the target name there" is much easier to grok. It's called top-down programming. The tr/sed/sed/blah munging is not as simple, and not as obvious. In fact, it's several times less obvious. Take both to a novice and ask their opinion on this. I challenge you. --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 )