News for hackers. Stuff that matters.
Re:Ubuntu 16.04 (Xenial Xerus) by peatmoss on Thursday April 21, 2016 @10:30AM (#11542404)
You're getting downvoted to oblivion, but I'm old enough to remember not being able to take bash for granted. The default shell on some modern systems (OpenBSD for example) comes to mind as well. I feel this battle has mostly been lost, however.
Re:Ubuntu 16.04 (Xenial Xerus) by notatoad on Thursday April 21, 2016 @11:24AM (#11542830)
Everything old is new again - distros targeted at running inside docker containers (like Alpine) are shipping without bash. Not taking bash for granted is still a good plan.
Re:Ubuntu 16.04 (Xenial Xerus) by stephenr on Thursday April 21, 2016 @10:37AM (#11542451)
HN coolkids downvoting advice that makes software more portable and reliable. What a fucking shock.
Re:Ubuntu 16.04 (Xenial Xerus) by privong on Thursday April 21, 2016 @11:04AM (#11542680)
> HN coolkids downvoting advice that makes software more portable and reliable. What a fucking shock.

A little more verbosity on the advice might have helped. I wouldn't have properly understood you were saying without @peatmoss's reply. So without the context, your original comment just seemed like knee-jerk bash-bashing.

Re:Ubuntu 16.04 (Xenial Xerus) by slavik81 on Thursday April 21, 2016 @02:29PM (#11544312)
Unless you've actually tested it with a shell other than bash, you should be marking it as bash. Otherwise it's likely it will not actually be portable between shells, and you will have made your software less reliable.

I've encountered many scripts written by developers on Fedora that totally fail over when run on Ubuntu specifically due to using #!/bin/sh when they really required #!/bin/bash.

Re:Ubuntu 16.04 (Xenial Xerus) by stephenr on Thursday April 21, 2016 @11:32PM (#11546899)
Unless you've tested it as a shell script you should be marking it as a recipe for a banana cream pie.

I specifically said "Write clean, posix-compliant shell scripts"

Do the same developers write Java code in a .cpp file and wonder why it doesn't work? Or put <?php tags in a .erb template?

Yes, you need to test to make sure that you wrote the correct things.

Re:Ubuntu 16.04 (Xenial Xerus) by 9912891 on Thursday April 21, 2016 @11:04AM (#11542678)
They use bash as a service. It's integrated in node.js 2041.4.1.
Re:Ubuntu 16.04 (Xenial Xerus) by pavanky on Thursday April 21, 2016 @10:51AM (#11542559)
Default on debian is dash.
Re:Ubuntu 16.04 (Xenial Xerus) by JdeBP on Thursday April 21, 2016 @11:49AM (#11543034)
And, this page being news about Ubuntu, one should note that this has been true for Ubuntu for fast approaching a decade, now; Debian having followed in the footsteps of Ubuntu, in this regard.

* https://wiki.ubuntu.com/DashAsBinSh

* https://wiki.ubuntu.com/DashAsBinSh/Spec

* https://lists.debian.org/debian-release/2007/07/msg00027.htm...

Re:Ubuntu 16.04 (Xenial Xerus) by lorenzhs on Thursday April 21, 2016 @11:03AM (#11542666)
But bash is installed by default if I'm not terribly mistaken, and it's classified as an essential package. If you put in a bash shebang, it should work.
Re:Ubuntu 16.04 (Xenial Xerus) by pavanky on Thursday April 21, 2016 @04:15PM (#11545029)
I have seen several people use #!/bin/sh and write bash code. This is going to break on debian machines when you do ./foo

If more people used #!/usr/bin/env bash, it wouldn't be that big of a deal.

Re:Ubuntu 16.04 (Xenial Xerus) by stephenr on Thursday April 21, 2016 @10:57PM (#11546794)
And they would have non portable code.

If they wrote posix compatible shell scripts it wouldn't be any big deal because they'd just work.

Re:Ubuntu 16.04 (Xenial Xerus) by wildmusings on Friday April 22, 2016 @06:12AM (#11548122)
There's like five comments from you in this thread and you seem very adamant about people not writing bash scripts. Have you considered that not everyone has the same requirements? Maybe they don't care about targeting systems that don't have bash installed. In that case, they can use the myriad of enhancements that bash offers to improve their productivity and happiness.