Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site bonnie.UUCP Path: utzoo!watmath!clyde!bonnie!lda From: lda@bonnie.UUCP (Larry Auton) Newsgroups: net.bugs.usg Subject: Re: PATH bug? Message-ID: <526@bonnie.UUCP> Date: Fri, 9-Aug-85 09:03:39 EDT Article-I.D.: bonnie.526 Posted: Fri Aug 9 09:03:39 1985 Date-Received: Thu, 15-Aug-85 02:58:21 EDT References: <807@plus5.UUCP> <2562@sun.uucp> Reply-To: lda@bonnie.UUCP (Larry Auton) Organization: AT&T Bell Laboratories, Whippany NJ Lines: 46 Summary: In article <2562@sun.uucp> guy@sun.uucp (Guy Harris) writes: >> If the current directory is specified as the last directory searched using >> a trailing ":" instead of ":." (in $PATH) then sh will not find executable >> files in the current directory. >> >> The problem only seems to occur when the current directory is searched last. >> >.... I.e., it doesn't know the difference between > > /bin:/usr/bin > >and > > /bin:/usr/bin: > >The fix should be obvious (look in "service.c") - unless this is a feature, >not a bug... > > Guy Harris If you consider the ':' in the PATH to be the terminator, and the end of the string to be a terminator only by necessity (i.e. convenience), then the "bug is not a bug". If PATH=:/bin:/usr/bin then the first component in the string is NULL, and thus by default, points to the current directory. If PATH=/bin::/usr/bin Then the second component is NULL, and the current directory is searched. Finally, if PATH=/bin:/usr/bin: then there *is no third component to the path*, and so the current directory is not searched. It's only a convenience to the user to allow paths that do not end with a ':'. All paths "should" end with a ':', just as all interrogatory sentences "should" end with a '?'. See what I mean -- Larry Auton (201)386-4272 ihnp4!bonnie!lda