this post was submitted on 15 Nov 2023
787 points (96.1% liked)

Programmer Humor

19589 readers
1071 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 21 points 1 year ago* (last edited 1 year ago) (10 children)

Still don't do this. If you use bash specific syntax with this head, that's a bashism and causes issues with people using zsh for example. Or with Debian/*buntu, who use dash as init shell.

Just use #!/bin/bash or #!/usr/bin/env bash if you're funny.

[–] [email protected] 8 points 1 year ago (6 children)

#!/bin/bash doesn't work on NixOS since bash is in the nix store somewhere, #!/usr/bin/env bash resolves the correct location regardless of where bash is

[–] [email protected] 3 points 1 year ago* (last edited 1 year ago) (5 children)

Are there any distos with /usr/bin/env in a different spot? I still believe that's the best approach for getting bash.

[–] [email protected] 2 points 1 year ago

My own. I use arch btw

load more comments (4 replies)
load more comments (4 replies)
load more comments (7 replies)