I am migrating from AIX to Solaris 10, but the version of /bin/sh
there is so old, that our scripts does not work. Can I somehow force perl to execute commands in `` via different shell (in my case, /bin/ksh
)?
I have A LOT of places with system calls, so changing them in every place is not very feasible. It would be great to find some global setting or something.
To get a POSIX environment on Solaris, you need to put the standard conformance directory (
/usr/xpg6/bin
, the number can be different in different Solaris versions) early in yourPATH
, before/usr/bin
or/bin
. There is a POSIX-conformingsh
in there (it'sksh
, in fact), and a few utilities react differently depending on$PATH
even though they come in a single executable.Either hard-code the directories:
or impose a standard
PATH
withgetconf
(which oddly enough isn't in thePOSIX
module):See this thread on Stack Overflow.
You can use shebang like this
add/repalce the above at the first line of script. It uses the /bin/ksh to execute the script.
A thought that may help:
Can you update /bin/sh to the same version that was on your old AIX server where these previously worked. The perl behavior has not changed, just your version of /bin/sh