this post was submitted on 11 Feb 2026
97 points (99.0% liked)

Programming

25522 readers
373 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] MonkderVierte@lemmy.zip 4 points 2 days ago* (last edited 1 day ago) (1 children)

Do you need POSIX compability?

  • If not, use bash-isms without shame

But call it a bash script then! Remember: #!/bin/sh is run by all kinds of shells; consider them POSIX. Bash is #!/bin/bash.

[–] cr1cket@sopuli.xyz 2 points 1 day ago (1 children)

Uhm, yes. I noted exactly that as well.

Also bash is not always at /bin/bash :-)

[–] MonkderVierte@lemmy.zip 2 points 1 day ago* (last edited 1 day ago) (1 children)

Yeah ok, /usr/bin/env then.

Edit: Or /bin/sh (oold convention) and check for bash.

[–] cr1cket@sopuli.xyz 3 points 1 day ago

Well, that won't work on openbsd (and probably freebsd), because non-default.stuff lands in /usr/local/bin.

For Linux you should be fine though.