Echo

a.v.reed avr at mtgzz.att.com
Fri Dec 2 08:50:54 AEST 1988


In article <6557 at june.cs.washington.edu>, ka at june.cs.washington.edu (Kenneth Almquist) writes:
< I've been implementing a public domain shell and I'm wondering what to
< do about the echo builtin.  The System V echo command interprets a number
< of escape sequences (e.g. \n for newline) which the BSD echo does not,
< so I can...
< 
< 1.  Implement the System V echo on the grounds that it will make it easier
<     to run System V shell scripts.
< 
< 2.  Implement the BSD echo on the grounds that it's the "right" approach
<     (since the System V echo is useless if you want to echo an arbitrary
<     string unchanged).
< 
< 3.  Don't provide an echo builtin, so users get whatever echo command is
<     installed in /bin.  This follows the principle of least surprise, but
<     it makes shell scripts run slowly and does nothing for portability.
< 
< Any suggestions?  In particular I would like to know if any standards
< organizations have addressed the semantics of echo.  Does anyone know
< what the merged AT&T/SUN UNIX is going to do about echo?
< 				Kenneth Almquist

Dave Korn's approach was to do a new builtin, print, with options to
emulate either "echo". "Echo" is initially aliased to work like the local
/bin/echo, whichever one that happens to be, but with the user having
the option to change it to his/her preference. I recommend Bolsky and
Korn's "KORNSHELL" book for details.

				Adam Reed (avr at mtgzz.att.com)



More information about the Comp.unix.wizards mailing list