* Bug in Korn Shell echo
@ 1994-07-08 11:18 Richard Coop
1994-07-08 20:34 ` Torbj|rn Lindgren
1994-07-11 16:03 ` Bill Scott WAS
0 siblings, 2 replies; 3+ messages in thread
From: Richard Coop @ 1994-07-08 11:18 UTC (permalink / raw)
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 $
Anyone else experienced this?
--------------------------------
Richard Coop,
Systems Support,
Imperial Cancer Research Fund,
London, UK
--------------------------------
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Bug in Korn Shell echo
1994-07-08 11:18 Bug in Korn Shell echo Richard Coop
@ 1994-07-08 20:34 ` Torbj|rn Lindgren
1994-07-11 16:03 ` Bill Scott WAS
1 sibling, 0 replies; 3+ messages in thread
From: Torbj|rn Lindgren @ 1994-07-08 20:34 UTC (permalink / raw)
In article <2vjcn2$qhb@dapsun.lif.icnet.uk>,
Richard Coop <coop@europa.lif.icnet.uk> wrote:
>If you begin the PATH= declaration with /bin then the built in 'echo'
>command fails to recognise escape sequences yet the built in 'print'
built in 'echo' ? Are you sure it's built in? It isn't in OSF/1 2.0's
ksh (I don't have access to 1.3), and this would explain the
behaviour.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Bug in Korn Shell echo
1994-07-08 11:18 Bug in Korn Shell echo Richard Coop
1994-07-08 20:34 ` Torbj|rn Lindgren
@ 1994-07-11 16:03 ` Bill Scott WAS
1 sibling, 0 replies; 3+ messages in thread
From: Bill Scott WAS @ 1994-07-11 16:03 UTC (permalink / raw)
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)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1994-07-11 16:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-07-08 11:18 Bug in Korn Shell echo Richard Coop
1994-07-08 20:34 ` Torbj|rn Lindgren
1994-07-11 16:03 ` Bill Scott WAS
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox