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:
I hope that helps!
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
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:
I hope that helps!
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.