Python surpasses Perl in popularity?

Stephane Chazelas stephane.chazelas at unicyclist.com
Mon Dec 1 11:08:16 EST 2008


2008-12-1, 10:16(+00), Andre Majorel:
[...]
>> Tru64:
>>   /bin/sh can behave either as a Bourne shell or a POSIX shell
>>   (ksh88) depending on the environment
>
> How does it decide ? argv[0] ? isatty (STDIN_FILENO) ?

That was answered in another article with a quote of the sh man
page on Tru64: via an environment variable: BIN_SH.

>> most Linux based systems and most other Unices:
>>   /bin/sh is a POSIX compliant shell (bash generally for Linux)
>>   and there's no Bourne shell (either there has never been or it
>>   has been removed/replaced by a POSIX shell).
>
> Two other Unixen I know of that have a non-POSIX sh are SCO Open
> Server and UnixWare. I'm not sure they even provide a
> POSIX-compliant alternative like Solaris does.

Again, see http://www.in-ulm.de/~mascheck/various/shells/

[...]
> Many people assume "standard" equates "portable". As far as
> shell programming is concerned, the safest way to get portability
> is to ignore the standard and code for the Bourne shell.

Yes, it's enough and relatively safe in most cases. It's the
only option if you want to be portable to systems over 15 years
old.

But nowadays, especially since the specifications have been made
public, I find that it is sufficiently widespread to make POSIX a
safer bet. At least having a specification gives you some sort
of guarantee: if you write your script by the rules that are
clearly (most of the time) specified, then it should work on any
compliant system. If it doesn't work, then it's not your fault
(though it's true in many case, you'll still be the one who'll
have to do something about it).

-- 
Stéphane



More information about the Python-list mailing list