Echo

Root Boy Jim rbj at nav.icst.nbs.gov
Fri Dec 23 10:57:38 AEST 1988


? From: Doug Gwyn  <gwyn at smoke.brl.mil>

? In article <949 at riddle.UUCP> domo at riddle.UUCP (Dominic Dunlop) writes:
? >    In release 4.0, the echo command has been enhanced to support both the
? >    SunOS and UNIX System V version of the command.  echo automatically
? >    selects between the two definitions according to the value of the PATH
? >    variable.  The UNIX System V definition is the default definition.
? >    However, if the PATH contains the entry /usr/ucb, and that entry comes
? >    before /usr/bin, then the SunOS version of echo is selected.

? What a botch this is!  Nobody I know of puts /usr/ucb before /usr/bin
? even on native BSD systems.  I wouldn't risk that in shell scripts,
? either, so in effect they have added a mechanism that will be of no
? practical use.  And, there is STILL no way to disable \-escape mapping
? in the System V environment.

Sorry, Doug, /usr/ucb comes first by default. It has to, otherwise you'd
end up running /bin/mail when you typed mail. In 4.2, /usr/bin also
contained the old version of the man command, which did not pipe thru
more, was a shell script, and probably didn't even work. There are also
two versions of grep, one in /bin, one in /usr/ucb. What's the difference?
Who cares? I use egrep all the time anyway.


In my experience, only inexperienced users put /usr/ucb last.

As it turns out, $PATH is set by login, not csh.

However, I do agree this is a botch. I vote for your version of echo.

And choosing between /usr/bin and /usr/ucb seems wrong. I would think
that the choice should be made based on /bin or /5bin.

	(Root Boy) Jim Cottrell	(301) 975-5688
	<rbj at nav.icst.nbs.gov> or <rbj at icst-cmr.arpa>
	Crackers and Worms -- Breakfast of Champions!



More information about the Comp.unix.wizards mailing list