Quote:
Originally Posted by
syregnar86
. . .
It has benefited me in becoming familiar with different shells. However, I'm having a hard time understanding the purpose of the shell and why there are so many shells out there and the importance or instance of using one over the other.
There's no priority of any shell; they were created with different targets in mind: fulfill any possible and imaginable desire towards a shell; tiny in ressource usage; mathematical functions built in; what have you...
Quote:
I understand zsh is very powerful. However, I see the same with bash. I wrote a few simple scripts in bash as well as zsh and see that they are very familiar in syntax. I've also found out that it doesn't matter what shell I'm in when I want to run a script.
That's not quite true: although most shell share an intersection of internal commands, every single shell has its idiosyncrasies. If you make use of the latter in your script, it will fail if run by other shells.
Quote:
For example, #!/bin/bash, stating this in the top of my bash script still allows me to run it in zsh.
Yes it does as it is a non-executable comment. If, on the other hand, you
chmod that script to be executable and launch it, the CLI checks that "shebang" comment and uses that command to run the script.
Quote:
It also seems that no matter what shell your currently in the commands at the command line are always the same as far as navigating around.
There's internal (builtin) and external commands. While the external cmds depend on the installation and are identical no matter what shell you deploy, the builtins may severely differ between shells.
Quote:
Therefore, what's the purpose of the shell and instances/advantages of using one over the over?
Shells are CLIs (command language interpreter) and thus constitute the interface between you (user) and the "system". They read your commands, interpret them, and call one or many system functions/programs to execute your command. Advantages of either: none except satisfy proclivities.