zsh-users
 help / color / mirror / code / Atom feed
* Full path with ksh emulation
@ 2006-01-05 10:33 Tony Hasler
  0 siblings, 0 replies; 3+ messages in thread
From: Tony Hasler @ 2006-01-05 10:33 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 1166 bytes --]

Hi,

 

A large client of mine is migrating a bunch of ksh scripts to Linux that
have previously run on HP-UX and Solaris and has discovered that many of
them break because the standard Linux version of ksh (pdksh) creates the
child on right side of a pipe rather than the left - a well documented
incompatibility of the Linux ksh that shows no prospect of ever being
considered a "bug" and hence no prospect of ever being "fixed".

 

Accordingly, they have hit upon the idea of using zsh to emulate ksh.  That
certainly solves the original problem, but introduces a new one.  In ksh the
'whence' command always gives you the absolute path of its argument.  So
'whence $0' always gives a full path even if the command was executed by
typing './myscript'.  I can find no straightforward way to do this in zsh.
Bear in mind that the scripts will run with ksh on HP-UX and Solaris - as
they have for years - but will be modified to run with zsh on Linux with a
command such as:

 

If [[ -z $ZSH_VERSION ]]

then

if [[ -x /usr/local/bin/zsh ]]

then

/usr/local/bin/zsh $@

exit $?

            fi

else

            emulate ksh

fi 

 

Any ideas?

 

 

--Tony

 


[-- Attachment #2: Type: text/html, Size: 5736 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-01-05 17:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <200601051033.k05AXq2p005908@rly12c.srv.mailcontrol.com>
2006-01-05 12:44 ` Full path with ksh emulation Peter Stephenson
2006-01-05 17:57   ` Brian K. White
2006-01-05 10:33 Tony Hasler

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).