Re: KSH: Alternative shell interpreter path ?
From: Jeremiah DeWitt Weiner (jdw_at_panix.com)
Date: 06/24/05
- Previous message: remove_Bill_Wyatt_this: "Re: KSH: Alternative shell interpreter path ?"
- In reply to: Thorsten Knopel: "KSH: Alternative shell interpreter path ?"
- Next in thread: Ed Morton: "Re: KSH: Alternative shell interpreter path ?"
- Reply: Ed Morton: "Re: KSH: Alternative shell interpreter path ?"
- Reply: Michael Tosch: "Re: KSH: Alternative shell interpreter path ?"
- Reply: Thorsten Knopel: "Re: KSH: Alternative shell interpreter path ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 24 Jun 2005 16:23:03 +0000 (UTC)
Thorsten Knopel <to_stupid@gmx.de> wrote:
> i like to use a ksh script on difference System e.g. Linux and UnixWare.
> On both systems the shell has another path. for example for Linux
> :/opt/bin/ksh and for UnixWare /bin/ksh.
Run your script using /bin/sh, which is always guaranteed to be
there. Then, inside your script, exec the script with ksh. You have to
be a little careful that the script doesn't end up in an infinite loop,
but you can do it something like this:
#!/bin/sh
PATH=$PATH:/opt/bin
if [ -z "$IN_KSH" ] ; then
IN_KSH=true exec ksh $0 $@
else
(real code goes here)
fi
Warning - this code is not very well tested, and is not guaranteed to
work! In particular, I don't know what the limitations of UnixWare's
/bin/sh might be.
JDW
- Previous message: remove_Bill_Wyatt_this: "Re: KSH: Alternative shell interpreter path ?"
- In reply to: Thorsten Knopel: "KSH: Alternative shell interpreter path ?"
- Next in thread: Ed Morton: "Re: KSH: Alternative shell interpreter path ?"
- Reply: Ed Morton: "Re: KSH: Alternative shell interpreter path ?"
- Reply: Michael Tosch: "Re: KSH: Alternative shell interpreter path ?"
- Reply: Thorsten Knopel: "Re: KSH: Alternative shell interpreter path ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|