Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!usc!apple!uokmax!munnari.oz.au!sirius.ucs.adelaide.edu.au!augean!idall From: idall@augean.OZ (Ian Dall) Newsgroups: comp.unix.wizards Subject: Re: Possible bug in SunOS System V echo? Message-ID: <800@augean.OZ> Date: 3 May 90 05:49:21 GMT References: <4852@helios.TAMU.EDU> <14020094@hpisod2.HP.COM> <12762@smoke.BRL.MIL> Organization: Engineering Faculty, University of Adelaide, Australia Lines: 41 Reply-To: In article <12762@smoke.BRL.MIL> gwyn@smoke.BRL.MIL (Doug Gwyn) writes: >In article <14020094@hpisod2.HP.COM> decot@hpisod2.HP.COM (Dave Decot) writes: >-If thou requirest special processing beyond simply echoing printing >-characters followed by a newline, thou shalt use the "printf" utility: >- printf "Hi there!\n\nEnter your name: " > >Well, that's dumb. Now I have to support TWO commands, where one would do. >What sort of standardization is this? Hmm. Well it might be dumb that we got into the two echo mess, but how else would we get out? If *I* was writing the standard, I would define echo to do exactly that with *no* interpretation of options or escape sequences. If you want a new line do echo "foo bar$NL" where NL is defined appropriatly, and let the shell put it in for you. I actually keep a little program like that around (I call it echo_args) which I find very useful for debugging programs which exec other programs. If that were the case, printf would still be required. The problem is that there is know way of changing echo's default behaviour without breaking it: echo -c foo should output -c foo and echo foo\c should output foo\c