Possible bug in SunOS System V echo?

Martin Weitzel martin at mwtech.UUCP
Tue Apr 10 00:47:29 AEST 1990


In article <12545 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn) writes:
>In article <4852 at helios.TAMU.EDU> greg at eemips.tamu.edu (Greg Economides) writes:
>>Has anyone noticed a strange problem using the 'echo -n' command in 
>>SunOS 4.0.2?  Using the SystemV echo (/usr/5bin/echo) the -n switch
>>(which causes NO newline to be output after the echoed text) doesn't
>>work.  If I give a command like:
>>echo -n Hello world
>>I get:
>>-n Hello world <CR>
>
>That's exactly what you should get using System V "echo".
>
>This is one of those annoying gratuitous incompatibilities among UNIX
>variants. 
[more deleted]

I did wait some days to see if somebody else would mention ...
now it seems to be my turn:

Note also, that SysV Rel 3 introduces the -n option again to mean "no
linefeed". The \c-convention lives on, the programmer has the choice.

It seems, that AT&T just waited long enough to cause many programmers
headaches how to convert existing scripts and to invent `portable'
solutions, and - with the `XENIX compatibility' - the "-n"-option
slipped back into SysV.

BTW: Everyone who wants to read more about how to supress echo's newline
should take a look to "The UNIX Programming Environment" by Kernighan&Pike,
page 79 -- you'll find a nice little tale there ....
-- 
Martin Weitzel, email: martin at mwtech.UUCP, voice: 49-(0)6151-6 56 83



More information about the Comp.unix.wizards mailing list