Hi,

        in moving from RHEL3 to RHEL5, there is a change from pdksh to
AT&T ksh93. We have hundreds of scripts that are primarily written for
HP-UX but are also run on Linux. 

The problem is that pdksh and HP's ksh both support expanding
backslashed escapes (such as "\c") with their builtin "echo" command as
default behavior. While the ksh93 echo is apparently a builtin, it
appears to use the standalone /bin/echo. The man page clarifies that
echo is a builtin, but if backslash-escapes are present, the external
echo command is called. The rub is that the external echo command
requires a "-e" be passed to get that behavior.

I cannot modify all the scripts in question to use the ksh builtin
"print" rather than echo so I am looking for some other option(s). So
far, I've thought I could:

1) rename /bin/echo to /bin/echo-orig and create /bin/echo as a script
that calls "/bin/echo-orig -e". The problem with that is I don't know
what other shell(s) that may break.

2) making a copy of zsh as ksh and use the compatibility features. A
quick test shows that zsh-as-ksh works with the backslashed escapes. In
this case, I have almost no experience with zsh, and none with ksh
compatibility mode.

3) grabbing the psksh SRPM from RedHat and trying to build that as a
replacement for ksh93.

I can't use an alias or function because many of the scripts are called
by cron and/or executed via rsh...

Any alternate suggestions? Has anyone else faced this already and come
up with a better solution?

Thanks,

Kevin




_______________________________________________
rhelv5-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/rhelv5-list

Reply via email to