Ask a Question related to Sun Solaris, Design and Development.
-
Rich Teer #1
/bin/ksh vs /usr/xpg4/bin/sh
Hi all,
I have a couple of questions regarding /usr/xpg4/bin/sh and
/bin/ksh. On Solaris 8 (and perhaps earlier releases I don't
have to hand here), /usr/xpg4/bin/sh is a symbolic link to
/bin/ksh, but on Solaris 9 it isn't. Is there any reason for
this? Also, in S9 the files have different sizes, suggesting
that they're no longer identical. If that's the case, what,
in a nutshell, are the differences between the two?
A side observation is that standard conforming apps now use
/usr/xpg4/bin/sh instead of /bin/ksh, when using system or
popen, as the man pages for those functions state.
TIA,
--
Rich Teer, SCNA, SCSA
President,
Rite Online Inc.
Voice: +1 (250) 979-1638
URL: [url]http://www.rite-online.net[/url]
Rich Teer Guest
-
Paul Eggert #2
Re: /bin/ksh vs /usr/xpg4/bin/sh
Rich Teer <rich.teer@rite-group.com> writes:
It's the same reason that Bash behaves differently if you invoke it as> /usr/xpg4/bin/sh is a symbolic link to /bin/ksh, but on Solaris 9 it
> isn't. Is there any reason for this?
/bin/sh on GNU/Linux systems. Namely, in a few cases the POSIX
standard requires behavior that the ksh developer thinks is bogus.
This is briefly discussed in the ksh man page on Solaris 9.
For example, on Solaris 9:
Command Result in /bin/ksh Result in /usr/xpg4/bin/sh
echo $((010+10)) 20 18
[ 10 -le $((011)) ] true false
It's not just Solaris 9, by the way. It also happens on Solaris 8
after you install Sun patch 110662-06 or later. The POSIX-conformance
bug hasn't been fixed on Solaris 7; dunno if it ever will be.
/bin/bash conforms to POSIX here, so it agrees with /usr/xpg4/bin/sh.
Paul Eggert Guest
-
Markus Gyger #3
Re: /bin/ksh vs /usr/xpg4/bin/sh
Rich Teer <rich.teer@rite-group.com> writes:
/usr/xpg4/bin/sh evaluates $((010)) to 8, /usr/bin/ksh> On Solaris 8 (and perhaps earlier releases I don't
> have to hand here), /usr/xpg4/bin/sh is a symbolic link to
> /bin/ksh, but on Solaris 9 it isn't.
to 10. $((8#10)) evaluates to 8 on both. See man ksh(1).
/usr/xpg4/bin/sh is now part of SUNWcsu (core bundle),
before it belonged to SUNWxcu4 (optional).
Markus
Markus Gyger Guest
-
Rich Teer #4
Re: /bin/ksh vs /usr/xpg4/bin/sh
On 5 Aug 2003, Markus Gyger wrote:
Got it; thanks guys.> /usr/xpg4/bin/sh evaluates $((010)) to 8, /usr/bin/ksh
> to 10. $((8#10)) evaluates to 8 on both. See man ksh(1).
> /usr/xpg4/bin/sh is now part of SUNWcsu (core bundle),
> before it belonged to SUNWxcu4 (optional).
--
Rich Teer, SCNA, SCSA
President,
Rite Online Inc.
Voice: +1 (250) 979-1638
URL: [url]http://www.rite-online.net[/url]
Rich Teer Guest



Reply With Quote

