Command Shells - The Quirks, The Pros and The Cons
OctaneZ asks "I am not trying to start a flame war here, but I would personally be very interested in seeing an analysis, both pros and cons, of all of the common shells: bourne, bash, csh, tcsh, and korn. I understand that a lot of linux users swear by bash because it is the default, but they all have there own "personalities" what does everyone think?" Interesting question. I'd be interested in hearing why some folks prefer csh over bash.
csh: This is used as the default shell on AIX. It has some newt features like ! and !! which allow a user to automajically execute a command in the history. Bash also support shis. In fact most of what csh can do bash can do to. I often find myself usinjg csh commands in bash as I work on an AIX server machine at work. csh uses setenv where bash uses export
ksh: or korn. I hate the name core shell it makes me think of something that wel .. it allows one to set up a command line editor. If you like vi you can have a vi on the command line sort of feeling.
bourne: I believe the bourne shell is used on the BSD's. I did try freebsd once and believe that I was using bournce shell. I found it primative compaared to bash. There was a greater learning curve. There seemed to be more to setup, but that could have been FreeBSD itself. There was a history, but I was not sure hw to access it.
Now bash: bash allows one to use ther arrow keys tonavigate thru the history to make executing commands easier. However this is not the only way to execute the history, one can the ! or !! (!69 will execute teh 69 th command in the history file). both ksh and bash use sthe export command to set envariables. I also believe that you can set vi as your command line editor to execute vi commands in the bash shell. To me bash is more like DOS, and thus you do not deal with the quirks of a command shell as much as you deal with the learning the unix commands, thus it is easier to use.
just muy .02 cents. I am sure that others have there opinions. So send flames > /dev/null and moderate -1G
send flames > /dev/null
Only 'flamers' flame!
FreeBSD's default shell is also csh. I personally cannot stand csh, but find tcsh to be perfect for an interactive command-line shell. (I prefer bash for scripting, however, but that wasn't part of the original question.) tcsh also has command-line history which can be accessed with the arrow keys like in bash.
I tried switching my default shell from tcsh to bash this summer as a test (to become more of a stereotypical second-wave unix dork, I guess), but found it very annoying in many respects compared to tcsh, mostly in the way it handles tab-completion. Needless to say, I'm still using tcsh and probably always will be.
(To sum it up: tcsh is the way to go for me. Stay the hell away from csh, and, if you use and like ksh, I'm worried about you.)
- A.P.
--
"One World, one Web, one Program" - Microsoft promotional ad
"Remember when the U.S. had a drug problem, and then we declared a War On Drugs, and now you can't buy drugs anymore?"
Coming from MS-DOS and JP Software's 4DOS, I found bash the easiest shell to adapt to, as a lot of good ideas in 4DOS appear to have come from bash (most notably the up/down arrow keys to navigate command history, and tab completion). bash is a little more demanding on system resources than most of the competition, if you're limited to somewhat older hardware. I think of bash as the mutt of shells, if a bit more bloated than mutt compared to other mail agents.
Fuck Slashdot
Here's a sample zsh script to get the feel for it:
#!/bin/zsh
for file in "$@"
do
if [ "${file}" != "${(L)file}" -a ! -e "${(L)file}" ]
then
echo "${file} => ${(L)file}"
mv "${file}" "${(L)file}"
fi
done
Which naturally takes renames any file whose name is not all lowercase to be all lowercase. Great for junk imported from brain-damaged operating systems.
Anyways, try it out yourself. Worst that can happen is you won't like it and stop using it. I doubt it, though. Try it, you'll like it!
--
"Convictions are more dangerous enemies of truth than lies."