lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Thu, Feb 27, 2014 at 08:59:05PM +0100, Petite Abeille wrote:
> Salut Gary,
> 
> On Feb 27, 2014, at 1:09 AM, Gary V. Vaughan <gary@vaughan.pe> wrote:
> 
> >> Is using PIPESTATUS reasonable enough?
> > 
> > That presumes /bin/sh is bash, which is not the case except on GNU/Linux -- and not all the time even there.
> 
> $ uname
> Darwin
> 
> $ /bin/sh --version
> GNU bash, version 3.2.51(1)-release (x86_64-apple-darwin13)
> Copyright (C) 2007 Free Software Foundation, Inc.
> 
> So, looks like Mac OS X is bash friendly as well. As is, say, Cygwin.
<snip> 
> Right. Considering the constrained, but rather limited number of
> environments I have to deal with in the immediate future (linux & cygwin
> mostly), I don?t mind a bit of bashism to go through the day. Expediency
> over portability :)
> 

william@sjc0:~$ uname
Linux
william@sjc0:~$ /bin/sh --version
/bin/sh: 0: Illegal option --

Debian and Debian derivatives use dash as their system interpreter, not
bash. Dash descends from ash, and strictly adheres to POSIX (sometimes
annoyingly so, given how portable are many Korn shell features).

If you want bash, you should call it explicitly.