[ale] changing dash to bash in ubuntu

Geoffrey Myers lists at serioustechnology.com
Tue Feb 22 07:11:38 EST 2011


arxaaron wrote:
> On 2011/02/21, at 09:06 , Lightner, Jeff wrote:
> 
>> A couple of notes on the thread:
>>
>> Issues with /bin/sh being linked to things other than bash aren't  
>> new -
>> I've seen them discussed on other forums for more than a yar.
>>
>> One poster talked about "sh" in a way that led me to believe he was
>> discussing the original Bourne Shell.   The POSIX shell (which is sh  
>> in
>> say HP-UX) is more like Korn Shell (ksh).
>>
>> Another poster talked about pdksh - that was an abomination that  
>> didn't
>> really do things quite the way ksh did.   Linux now has ksh available
>> for those of old farts that knew and liked ksh.   (For RHEL users you
>> could get ksh instead of pdksh as of RHEL5 from the repositories.)
>>
>> I agree with others though - If you design something in a specific  
>> shell
>> make your interpreter line specific to that shell:  #!/bin/bash,
>> #!/bin/ksh, or even #!/bin/sh if it is on a system that has that as a
>> native POSIX shell.   If you're writing it for portability you might
>> want to put tests in that help to verify what shell it is actually  
>> using
>> and note there are differences sometimes from version to version.
>> Things I wrote using #!/bin/ksh when it was pdksh had some minor  
>> issues
>> when it was real ksh.
> 
> Good points on version checks.  Some involved scripts that
> I've written for bash on Linux needed tweaking to run with the
> BSD bash on Mac OSeX.  Biggest issue was some built in bash
> string functions that I used in Linux were missing in BSD.
> The standard suite of included external shell programs can
> be different or be missing flags as well.  I recall some slightly
> different quote handling being the quirkiest debugging
> challenge, though.

I've found the ksh on Mac to be virtually identical to pdksh on Linux. 
So far. :)  I've not run into any issues with differences.


-- 
Until later, Geoffrey

"I predict future happiness for America if they can prevent
the government from wasting the labors of the people under
the pretense of taking care of them."
- Thomas Jefferson


More information about the Ale mailing list