Most common Unix/Linux shell

For Linux i'd say bash, while I see that classical Unix variants seem to prefer csh.


Since I want my scripts to run on all systems I want (well, as many as possible), I write and test my scripts with Bourne Shell (/bin/sh) which is present in all Unix systems I ever met.

Just need to be aware that on some systems /bin/sh is in fact bash (ex: my Mac).


It's perl.

I always find perl even on some old solaris 2.6 and writing perl is far more portable than writing shell script, keeping in mind that /bin/sh may vary a lot. Then instead of writing some csh/ksh/bash, where i'll always find one server with the wrong version of the shell for feature X, i've switched to perl. It's sometimes a bit more verbose, but i get 100% portability for my work.

And no need to say that a shell itself does nothing: if you don't have to correct grep/awk/sed versions (and there are dozens of awk implementations), you're screwed, while perl pattern matching, data structures, etc are universal.


Mac OS X switched from tcsh to bash as the default login shell around the 10.3 release. Solaris tends to default to sh for root and csh for regular users.