Re: shell
- From: Stephane Chazelas <stephane_chazelas@xxxxxxxx>
- Date: 22 Mar 2006 10:45:13 GMT
On 21 Mar 2006 14:51:02 -0800, saghster wrote:
Well i've problem about the shell in solaris with[...]
linux(freebsd-fedora-debian), the question is what is the diferent in
this shell, and your complegity...?
The sh in /bin in Solaris is not a Unix shell, it's a
Bourne shell (a shell from the old age), only there for backward
compatibility for old scripts.
The Unix shell on Solaris is in /usr/xpg4/bin.
Solaris is a bit annoying with that as it chose to keep the
deprecated stuff in the usual place (/bin, /usr/bin). You get
similar problems with sed, awk, tr... You must issue a
PATH=$(getconf PATH):$PATH to have Solaris behave in a more Unix
(as in "conformant to the modern Unix specifications") way (the
default PATH is generally configured so that the old tools are
used instead of the new ones).
To write a Unix/POSIX conformant script portable to Solaris, you
generally have to do something like:
#! /bin/sh -
# ensure `Unix' shell for Solaris
false ^ true && [ -x /usr/xpg4/bin/sh ] && exec /usr/xpg4/bin/sh - "$0" ${1+"$@"}
# ensure `Unix' utilities
PATH=$(command -p getconf PATH; :):$PATH
export PATH
If you need to port the script to some other system that also
chose to have the standard tools in some unusual place, you'll
probably need to adapt that preamble.
--
Stephane
.
- References:
- shell
- From: saghster
- shell
- Prev by Date: Re: BACKSPACE in vi
- Next by Date: Re: BACKSPACE in vi
- Previous by thread: shell
- Next by thread: Re: shell
- Index(es):
Relevant Pages
|