News for hackers. Stuff that matters.
Re:Ubuntu 16.04 (Xenial Xerus) by kps on Thursday April 21, 2016 @11:32AM (#11542897)
And test them on a shell that isn't bash. Even with the --posix option bash accepts non-standard bashisms, particularly the execrable 'extension' of '>&'.
Re:Ubuntu 16.04 (Xenial Xerus) by bryanlarsen on Thursday April 21, 2016 @11:53AM (#11543072)
That's why I always put "#!/usr/bin/env bash" at the top of my scripts. Most were written to be portable, but unless it's been well tested, it's best to consider it not portable. Fail early and predictably rather than in strange ways.
Re:Ubuntu 16.04 (Xenial Xerus) by stephenr on Thursday April 21, 2016 @01:30PM (#11543843)
That.. Isn't the solution. The point is that bash is not a good target for shell scripts, not that you should use env to detect the location of bash.
Re:Ubuntu 16.04 (Xenial Xerus) by nailer on Friday April 22, 2016 @07:56AM (#11548453)
If you only use *nix platforms the default to bash, why not write bash scripts?