Follow

How do we encourage people to stop using #!/bin/bash?
That alone ports over 90% of Linux-specific scripts to BSD.

@farhan what's the better alternative?

is #!/usr/bin/env bash better?

@mdszy Yes, I did that on a few Firefox things stuff I didn't finish porting. Most of the time just #!/bin/sh works, but that's perfectly fine if you need bash.

@farhan gotcha

i generally used #!/usr/bin/env bash since it seemed to me to be a better practice, glad to know that it actually is, haha

@farhan nice nice

i definitely value portability when i'm writing bash scripts and stuff, glad to know using env helps so much

@farhan sounds like a better solution would be to make a BSD command or whatever to run scripts ignoring that line, rather than making everybody on earth update their scripts.

@farhan I know I'm guilty of using bash up there when I know the script will work on things like Sun's ancient /bin/sh. It's entirely because I know the systems my script needs to run on have bash installed.

Sadly, I don't think people will stop needlessly being bash-specific until the obvious porting issues affect them directly.

@yakkoj To be fair, Linux dominates the legacy Unix market. Anything else out there, including BSD which I love, is a rounding error.

Sign in to participate in the conversation
Mastodon for Tech Folks

This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either! We adhere to an adapted version of the TootCat Code of Conduct and have documented a list of blocked instances. Ash is the admin and is supported by Fuzzface, Brian!, and Daniel Glus as moderators. Hosting costs are largely covered by our generous supporters on Patreon – thanks for all the help!