OT: broken/useless ansi - console driver??

Brian K. White brian at aljex.com
Wed Oct 26 15:37:59 PDT 2005


----- Original Message ----- 
From: "Bob Stockler" <bob at trebor.iglou.com>
To: "Fplist (E-mail)" <filepro-list at seaslug.org>
Sent: Tuesday, October 25, 2005 1:13 PM
Subject: Re: OT: broken/useless ansi - console driver??


> Ken Brody wrote (on Mon, Oct 24, 2005 at 07:36:21PM -0400):
>
> | Quoting Bob Stockler (Mon, 24 Oct 2005 17:33:32 -0400):
> | [...]
> | > | Now, if only system() would run /bin/sh rather than the incompatible
> | > | /u95/bin/sh instead.  (Regardless of the SHELL setting.)
> | >
> | > Why?  What's incompatible about it?  It's the latest version of
> | > the REAL KornShell (ksh93) and is (mostly) backwards commpatible
> | > with the Bourne shell when doing what the Bourne shell would do.
> |
> | "echo -n" isn't supported, as it is in /bin/sh.  I'm sure there are
> | other minor differences like this as well.  This is probably because
> | /u95/bin/sh is really the Korn shell.  (Though it may behave differently
> | when run as "sh" rather than "ksh".  I haven't tested that.)
>
> In SCO OSR6 /bin/sh is the Bourne shell. /bin/ksh the KornShell
> (ksh88), /u95/bin/sh and /u95/bin/ksh are identical (ksh93).
>
> Some versions of bash respect the -n and some don't.  A test at
> the top of shell scripts meant to run on different platforms can
> determine whether to assign either "echo" or "/bin/echo" to the
> variable ECHO and use it throughout the script, or use "\c" which
> works in all cases.

\c \t \nnn  etc do not work in all cases.
In bash, you need echo -e for those to work, or you need to have done 
"set -O xpg_echo" earlier in the script or in .bashrc, which turns them on 
globally.
echo -e always works in bash, even if the global option was already set, but 
then echo -e does not work in other shells.
Also, xpg_echo didn't exist until bash 2.04, and maybe only later patch 
levels of that.

Nothing works everywhere except the empirical test you mentioned.

Brian K. White  --  brian at aljex.com  --  http://www.aljex.com/bkw/
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro  BBx    Linux  SCO  FreeBSD    #callahans  Satriani  Filk!



More information about the Filepro-list mailing list