
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 6,000 Views
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 5,829 Views
Well, first of all, that's great to see such questions because it shows a specialist not wanting to just write scripts, but striving to master their skills.
Second, we should consider if we are going to take portability into account.
If not, then yeah, no real difference between this two options.
But in my personal worldview a good production-ready script == portable script, meahwhile we aren't going to see /usr/bin/bash on Linux Mint for example.
$ ls -la /usr/bin/bash
ls: cannot access '/usr/bin/bash': No such file or directory
Even if we are all agree that Red Hat is better, still there's a lot of debian-based installations all around the world, right?
So the anwer becomes more particular, while the question itself starts to be even more interesting while we are diving deeper into this.
Did I mention how I love bash\zsh for this?)
According to wonderful "Bash idioms" book -- unsure if I can post link here, and my personal expirience, the best shebang-strings solutions are:
- /usr/bin/env bash # Still not ideal but is the best what humanity have for now. Side note: remember "#!/usr/bin/env python" form.
- /bin/bash - # The dash protects user from running your script on older versions of bash.
- /bin/bash.
I hope that helps!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 5,989 Views
Hello @Andres_Tarallo
Look, please, at:
root@notebook:~# ls -ldi /bin
24 lrwxrwxrwx. 1 root root 7 Jul 21 2023 /bin -> usr/bin
root@notebook:~# ls -ldi /usr/bin
7340035 dr-xr-xr-x. 2 root root 77824 Feb 7 08:29 /usr/bin
root@notebook:~# ls -ldi /bin/
7340035 dr-xr-xr-x. 2 root root 77824 Feb 7 08:29 /bin/
root@notebook:~#
So it is variant of hard or soft link, So no diff which one to use.
Good luck

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 5,830 Views
Well, first of all, that's great to see such questions because it shows a specialist not wanting to just write scripts, but striving to master their skills.
Second, we should consider if we are going to take portability into account.
If not, then yeah, no real difference between this two options.
But in my personal worldview a good production-ready script == portable script, meahwhile we aren't going to see /usr/bin/bash on Linux Mint for example.
$ ls -la /usr/bin/bash
ls: cannot access '/usr/bin/bash': No such file or directory
Even if we are all agree that Red Hat is better, still there's a lot of debian-based installations all around the world, right?
So the anwer becomes more particular, while the question itself starts to be even more interesting while we are diving deeper into this.
Did I mention how I love bash\zsh for this?)
According to wonderful "Bash idioms" book -- unsure if I can post link here, and my personal expirience, the best shebang-strings solutions are:
- /usr/bin/env bash # Still not ideal but is the best what humanity have for now. Side note: remember "#!/usr/bin/env python" form.
- /bin/bash - # The dash protects user from running your script on older versions of bash.
- /bin/bash.
I hope that helps!