On Sat, 30 Aug 2008 13:11, Cyrille Lefevre wrote:
> Andrew Clarke a écrit :
> > On Thu, 28 Aug 2008 20:23, you wrote:
>
> [snip]
>
> >> how about :
> >>
> >> if [ "${RANDOM}" != "${RANDOM}" ]; then
> >>    is='ksh'
> >> else
> >>    is='sh'
> >> fi
> >
> > that would identify bash as ksh. But way back it wouldn't have been a
> > problem.
>
> no, because bash may be identified using $BASH_VERSION as well as pdksh
> using $KSH_VERSION and zsh using $ZSH_VERSION.
>
Starting to get complicated isn't it? There's a number of good ideas coming 
back through the mailing list now.

Anyway, as I said, that was several years ago now, and I neglected to 
mention that the principle platform I had trouble with was on HP-UX where 
sh was actually a version of ksh-88. So the $0 name of the shell was no use 
to me for proving that the shell had ksh powers. I didn't care what the 
shell wanted to call itself, I just wanted it's super-powers.

It's more of a historical curiosity now I guess, since we can build our own 
ksh virtually everywhere. I have also noticed that the latest versions of 
pdksh are starting to get quite acceptable; which for me meant that it 
could successfully run my scripts. Also SuSE since about 10.1 has been 
supplying a real ksh under /ast/ksh (or similar) and symlinked into /bin 
and /usr/bin. I'm not sure which RPM package holds it, however.



_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to