I put a
#!/bin/ksh -u
line at the top of all of my scripts - ensure that I know what I am getting.
Why ksh - well it is the POSIX shell, so more likely to be portable to any non Linux Unix systems.
Ksh also has nice string handling that means that you don't need to use eval, there are other nice things over & above some shells. This is the sort of reason that people like to use bashisms - it does make for faster scripts -- but only if you need to do that sort of thing.
Posted Aug 6, 2009 15:54 UTC (Thu) by tzafrir (subscriber, #11501)
[Link]
$ whatis ksh
ksh (1) - the Z shell
Korn shell
Posted Aug 7, 2009 10:36 UTC (Fri) by nix (subscriber, #2304)
[Link]
Actually pdksh, used on Linux, has sufficiently many bugs not shared by other ksh implementations (many critical, some such actually documented as never to be fixed in the manpage!) that whenever I want a portable shell script of any complexity I write it in zsh. At least there's one implementation of that and bugs get fixed in it.