New Shell In Oracle Solaris 11

In Oracle Solaris 11, Korn Shell 93 (/usr/bin/ksh/ or usr/bin/ksh93) replaces both the Bourne Shell (/usr/bin/sh or /sbin/sh) and Korn Shell 88 (/usr/bin/ksh).

There are some incompatibilities between the shells. They are described in:

/usr/share/doc/ksh/COMPATIBILITY

If a script has compatibility problems you can use the legacy shell by changing the she-bang line:

If this doesn't work

Use This

#!/bin/ksh #!/usr/sunos/bin/ksh
#!/usr/bin/ksh #!/usr/sunos/bin/ksh
   
#!/bin/sh #!/usr/sunos/bin/sh
#!/usr/bin/sh #!/usr/sunos/bin/sh
#!/sbin/sh #!/usr/sunos/bin/sh

- Mike Gerdts http://blogs.oracle.com/zoneszone/

Website
Newsletter
Facebook
Twitter
Comments:

Thanks for posting this, even if it is without a William Hung reference. :)

Posted by Mike Gerdts on November 18, 2011 at 02:36 AM MST #

LOL. I couldn't bring myself to do it, Mike. I tried, but I couldn't!

Rick

Posted by Rick Ramsey on November 18, 2011 at 02:37 AM MST #

It's not really clear from this -- are you saying /bin/sh on Solaris 11 either does not exist or is actually the Korn shell?

Posted by Jeff Blaine on November 18, 2011 at 03:55 AM MST #

Consider this:

$ ls -ld /bin /sbin /usr/bin/sh /usr/bin/ksh* /usr/lib/isaexec /usr/bin/*/ksh* /usr/sbin/sh
lrwxrwxrwx 1 root root 9 Aug 18 11:59 /bin -> ./usr/bin/
lrwxrwxrwx 1 root root 10 Aug 18 11:59 /sbin -> ./usr/sbin/
-r-xr-xr-x 4 root bin 9768 Jun 2 09:06 /usr/bin/amd64/ksh*
-r-xr-xr-x 4 root bin 9768 Jun 2 09:06 /usr/bin/amd64/ksh93*
-r-xr-xr-x 4 root bin 8168 Jun 2 09:06 /usr/bin/i86/ksh*
-r-xr-xr-x 4 root bin 8168 Jun 2 09:06 /usr/bin/i86/ksh93*
-r-xr-xr-x 40 root bin 8200 Jun 2 09:05 /usr/bin/ksh*
-r-xr-xr-x 40 root bin 8200 Jun 2 09:05 /usr/bin/ksh93*
lrwxrwxrwx 1 root root 9 Aug 18 11:59 /usr/bin/sh -> i86/ksh93*
-r-xr-xr-x 40 root bin 8200 Jun 2 09:05 /usr/lib/isaexec*
lrwxrwxrwx 1 root root 16 Aug 18 11:59 /usr/sbin/sh -> ../bin/i86/ksh93*

That is saying:

- /bin is now a link to /usr/bin, as it has been for a very long time.
- /sbin is now a link to /usr/sbin - this is new in Solaris 11
- There are 64-bit (amd64/ksh amd64/ksh93) and 32-bit (i86/ksh i86/ksh93) versions of the ksh and ksh93 executables.
- /usr/bin/ksh is an isaexec(3C) wrapper to call the 32-bit or 64-bit version as needed. Note that since Solaris 11 only runs a 64-bit kernel, it will always select the 64-bit version.
- /usr/bin/sh and /usr/sbin/sh are symbolic links to the 32-bit version of ksh93.
- By virtue of the first bullet point above, /bin/sh is a symbolic link to the 32-bit version of ksh93.

Posted by guest on November 21, 2011 at 04:24 AM MST #

Hey, to further clarify,
is this only true for x86/AMD platform,
or is it also true FOR SPARC

Posted by guest on March 31, 2012 at 10:22 AM MDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Contributors:
Rick Ramsey
Kemer Thomson
and members of the OTN community

Search

Archives
« July 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  
       
Today
Blogs We Like