|
|
|
|
|
by eriknstr
3288 days ago
|
|
> I remember hitting some edge cases where some bespoke shell scripts don't work correctly on Ubuntu because DASH is a "slim" Bash alternative, so it doesn't have all the "bashisms". People say that, but usually the reason their scripts are not working is that they are using bashisms while retaining #!/usr/bin/env sh
or #!/bin/sh
rather than doing as they should when writing shell scripts that are using bash features; #!/usr/bin/env bash
I think it boils down to a lot of people being unaware of the difference between what is POSIX compliant and what is not, or even that there is such a distinction to be made.I write most of my shell scripts targeting bash, but I always use the hashbang that invokes to bash, and I also name my scripts like somescript.bash when it's a bash script and somescript.sh when it's POSIX shell. |
|