From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f678f,632615b996bda4a4 X-Google-Attributes: gidf678f,public X-Google-ArrivalTime: 1994-07-11 14:15:44 PST Path: bga.com!news.sprintlink.net!hookup!swrinde!news.dell.com!tadpole.com!uunet!ipxpress.aws.waii.com!ipxpress.aws.waii.com!bscott From: bscott@ipxpress.aws.waii.com (Bill Scott WAS) Newsgroups: comp.unix.osf.misc Subject: Re: Bug in Korn Shell echo Date: 11 Jul 1994 16:03:58 GMT Organization: Atlas Wireline Services Distribution: world Message-ID: <2vrqhe$9dn@ipxpress.aws.waii.com> References: <2vjcn2$qhb@dapsun.lif.icnet.uk> NNTP-Posting-Host: ipxpress.aws.waii.com In article <2vjcn2$qhb@dapsun.lif.icnet.uk>, coop@europa.lif.icnet.uk (Richard Coop) writes: |> Hi, |> |> We are running DEC OSF/1 V1.3A, V1.2 Worksystem Software on our ALPHA boxes |> and I seem to have stumbled on a bug in the Korn Shell implementation. |> |> If you begin the PATH= declaration with /bin then the built in 'echo' |> command fails to recognise escape sequences yet the built in 'print' |> command is fine. |> |> |> ie: |> |> $ PATH="/usr/bin:/bin" |> $ echo "no carriage return \c" CORRECT BEHAVIOUR |> no carriage return $ |> |> $ PATH="/bin:/usr/bin" |> $ echo "no carriage return \c" ERRONEOUS BEHAVIOUR |> no carriage return \c |> $ |> |> |> Yet 'print' works: |> |> $ PATH="/bin:/usr/bin" |> $ print "no carriage return \c" |> no carriage return $ |> Our Alphas have OSF/1 V2.0, so I cannot comment on V1.3A, but in V2.0 the "echo" command is not builtin in the Korn shell, so the echo command used is the one found first in the path. I cannot replicate your problem because in V2.0, /bin/echo, /usr/bin/echo and /usr/ucb/echo seem to all be the same modules and operate identically, all honoring the the escape sequences, so rearranging the order in the path has no effect. There have traditionally been two "echo" commands. Those originally based on BSD echo are often very simple and do not honor the escape sequences (eg. /bin/echo on our SunOS 4.1 machines). Those based on System 5 support more options, including escape sequences (eg. /usr/5bin/echo on our SunOS 4.1 machines). These are not bugs, but different implementations (though quite irritating when you are trying to write portable scripts). Bill (bscott@was.waii.com)