4.2/sysV difference

Guy Harris guy at sun.uucp
Fri Jan 17 06:35:06 AEST 1986


> I was recently debugging a routine using "execvp".  The bug was actually
> On 4.2 systems the environment variable "PATH" used by "execvp"
> to locate the directories to scan.  The path elements (directories)
> are separated by ':'.  They can also be separated by '-'.
> 
> If path=(/bin /usr/bin /usr/local ... /usr/new test-test), and 
> executable file in test-test, even when csh finds the executable,
> a small test program doing execvp for the file doens't find it.
> 
> It makes sense to me there is a reason for the termination of the
> element by '-', but I can't figure out what the reason is.

The reason is that at some point in UNIX's history (at AT&T, I presume), it
was considered a feature that path elements could be separated by '-'.  This
was later changed, but the change didn't propagate instantaneously to all
places where PATH variables were scanned.  As such, any systems which still
recognize '-' as a path separator have a bug.  It was, conceivably, not
fixed in UNIX/32V, which is what 4.xBSD is derived from.  It is *STILL* not
fixed in the System V, Release 2, VAX Version1 "make"!  (Fix: get rid of the
"*s1 != MINUS" clause in the first "while" loop in "execat" in "misc.c."  It
is, however, fixed in the 4.3BSD "execvp".

	Guy Harris



More information about the Comp.unix.wizards mailing list