🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #1554

Echo? What echo? Korn shell 88

#1554
From: FISH
Date: Fri, 19 Oct 1990 13:01
35 lines
1766 bytes
I have recently discovered a problem with ksh88. The print command has a flag
-s that allows you to place things into the history file, i.e.

print -s Hello there

will place "Hello there" in the history file. The manual claims that echo
uses the echo program which means that echo -s should print the string -s.
For reasons explained below this is the preferred behaviour.
However, it would appear that echo has been aliased to print, even though the
manual would claim that this is not the case and echo is /bin/echo like in the
Bourne shell and earlier versions of the K shell.

Has anyone had this problem and how did you crack it?

alias -x echo /bin/echo dosen't work and gives an error

neither does defining a function although you can do this without an error
message.

Background:

I have been trying to write a simple training manual for users that has
a worked example that uses the flag -s. This is to show some of the
dangers in using test with things like [ -s = -s  ], which works in            n
some implementations and not others. Unfortunately the way round it I discuss
using `if echo $arg | grep -s -e -s' no longer works if echo -s dosen't send
-s to stdout. I don't want to use the [[ ]] construct because we don't have
ksh88 across the whole site, even though I recomend its use if available.

Thanks in advance. Any ideas?

Francis Fish
Programmer / Analyst
Liverpool University Computer Laboratory
fish@uk.ac.liverpool
Technical Details
Message-ID: <90292.140155FISH@LIVERPOOL.AC.UK>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcsun!ukc!mucs!liv-cs!liv!fish

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcsun!ukc!mucs!liv-cs!liv!fish
From: FISH@LIVERPOOL.AC.UK
Newsgroups: comp.unix.shell
Subject: Echo? What echo? Korn shell 88
Message-ID: <90292.140155FISH@LIVERPOOL.AC.UK>
Date: 19 Oct 90 13:01:54 GMT
Organization: University of Liverpool
Lines: 35