Hi All,
Was wondering if anyone knows there are any separate rpms to be able to install a true bourne shell and not one linked to bash.
Thanks in advance,
Phil
I think no due to Copyright issues. The closest is probably dash which describes itself as a POSIX comptatible shell. Clive
On Mon, Nov 8, 2010 at 3:06 PM, Phil Savoie psavoie1783@rogers.com wrote:
Hi All,
Was wondering if anyone knows there are any separate rpms to be able to install a true bourne shell and not one linked to bash.
Bash has some options to run in compatibility mode. Not sure what you need, but may do the trick. It's useful if you need to build on Linux then move to another environment.
On 11/08/10 3:13 PM, Kwan Lowe wrote:
On Mon, Nov 8, 2010 at 3:06 PM, Phil Savoiepsavoie1783@rogers.com wrote:
Hi All,
Was wondering if anyone knows there are any separate rpms to be able to install a true bourne shell and not one linked to bash.
Bash has some options to run in compatibility mode. Not sure what you need, but may do the trick. It's useful if you need to build on Linux then move to another environment.
I thought it did that by default if it was invoked as /usr/bin/sh via the link ?
On Mon, Nov 08, 2010 at 03:39:22PM -0800, John R Pierce wrote:
On 11/08/10 3:13 PM, Kwan Lowe wrote:
On Mon, Nov 8, 2010 at 3:06 PM, Phil Savoiepsavoie1783@rogers.com wrote:
Hi All,
Was wondering if anyone knows there are any separate rpms to be able to
I thought it did that by default if it was invoked as /usr/bin/sh via the link ?
Doesn't seem to do so, with my strenuous test of typing sh then trying echo $UID. The true Bourne shell doesn't have that (which messed me up once when forgetting that and working on an AIX box. I think that's when I discovered that UID is a bash-ism and not a sh-ism.
Note that that is the only test I did--it might be that everything else is perfect.
IIRC, back when that happened (writing something portable and needing to test syntax), I got the best results with dash.
On 11/08/10 7:34 PM, Scott Robbins wrote:
On Mon, Nov 08, 2010 at 03:39:22PM -0800, John R Pierce wrote:
On 11/08/10 3:13 PM, Kwan Lowe wrote:
On Mon, Nov 8, 2010 at 3:06 PM, Phil Savoiepsavoie1783@rogers.com wrote:
Hi All,
Was wondering if anyone knows there are any separate rpms to be able to
I thought it did that by default if it was invoked as /usr/bin/sh via the link ?
Doesn't seem to do so, with my strenuous test of typing sh then trying echo $UID. The true Bourne shell doesn't have that (which messed me up once when forgetting that and working on an AIX box. I think that's when I discovered that UID is a bash-ism and not a sh-ism.
Note that that is the only test I did--it might be that everything else is perfect.
IIRC, back when that happened (writing something portable and needing to test syntax), I got the best results with dash.
ah, yes. bash as sh is a superset of sh. most anything written for sh should work, but lots and lots of stuff on bash as sh won't work on sh
but, then, I'm not sure sh on solaris is quite exactly the same as sh on aix. anyways, aix users usually uses ksh. but ksh on linux is a little sketchy.
On Mon, Nov 08, 2010 at 10:11:58PM -0800, John R Pierce wrote:
but, then, I'm not sure sh on solaris is quite exactly the same as sh on aix.
Right. There's no uber-standard /bin/sh. Very very old Unix systems had a /bin/sh that didn't even support functions. And let's not talk about the different "echo" commands between OSes. When writing portable code in /bin/sh you always have to make some assumptions.
anyways, aix users usually uses ksh. but ksh on linux is a little sketchy.
ksh93 is pretty good, but not quite as compatible as ksh88. ksh88 was the SVR4 standard shell (so solaris, aix, hpux, sco etc all had it). Unfortunately ksh88 wasn't free (speech) so pdksh was created and that's not quite compatible with ksh88 (eg 'echo hello | read a' gives different results). What I found funny was that zsh in ksh-compat mode was really really close (in 1993 I converted a 700 line ksh88 script to run under zsh in ksh-mode; required 2 changes in total).
On CentOS5 ksh-20100202-1.el5_5.1 is ksh93. It's possible to write code that works identically in ksh93 and ksh88 and that's pretty portable.
On Tue, Nov 9, 2010 at 12:13 AM, Kwan Lowe kwan.lowe@gmail.com wrote:
On Mon, Nov 8, 2010 at 3:06 PM, Phil Savoie psavoie1783@rogers.com wrote:
Hi All,
Was wondering if anyone knows there are any separate rpms to be able to install a true bourne shell and not one linked to bash.
Bash has some options to run in compatibility mode. Not sure what you need, but may do the trick. It's useful if you need to build on Linux then move to another environment.
In that case, tcshell might be a viable alternative. It's more like an addon for all OS's so the differences might well be smaller. Just a thought, not a thoroughly tested opinion.
BR Bent
I've not looked at it in a few years, but I seem to recall that ash was fairly close to the traditional Bourne syntax.
I don't know if it is helpful to your case, but if you have a script that is bash-specific, it is a good idea to change the magic line from # !/bin/sh to # !/bin/bash That way, if you're running it on non-Linux platforms it will either work or give you a useful error message up front (in the case that bash isn't installed).
Devin