[colug-432] Why Bourne Shell Compatible: Portability

Chris Clonch chris at theclonchs.com
Wed Aug 10 07:26:13 EDT 2011


On 08/09/2011 09:39 PM, jep200404 at columbus.rr.com wrote:
> On Tue, 9 Aug 2011 21:24:50 -0400, Scott Merrill <skippy at skippy.net> wrote:
> 
>> Jim, for the benefit of the class, can you elaborate on the overall
>> benefit of being sh-compatible? What, specifically, are your reasons
>> for wanting to avoid bash-isms?
> 
> Portability. 
> 
> The more one sticks to the narrow confines of compatibility with 
> the old Bourne shell, the more environments one's script will 
> work in. 

Distribution choices -- dash [1].

I recently ran across a situation where Debian-based distro's link
/bin/sh to dash [2] which does not implement all of the bash-isms.  Most
distro's link sh to bash.  Init scripts and the like, which are
accustomed to using bash-isms, find themselves with strange bugs...

1. http://en.wikipedia.org/wiki/Debian_Almquist_shell
2. http://wiki.debian.org/DashAsBinSh

-Chris



More information about the colug-432 mailing list