4 ms·
Which also happens to be the default or expected shell in the majority of sysv installs on Linux. '/bin/sh' symlinks to bash, shell scripts specify '/bin/sh' S
by astine 12y ago
Which also happens to be the default or expected shell in the majority of sysv installs on Linux. '/bin/sh' symlinks to bash, shell scripts specify '/bin/sh' So it's another example of a distinction without a difference to single out bash. Most sysadmins cannot just switch to ZSH to to write their init scripts.
- bronson 12y agoDebian and its many derivatives (including Ubunutu) use Dash, and the BSDs tend to use some form of Ash. I don't have the statistics but, if it's true that a majority of distros still use Bash for noninteractive use, it's a tiny majority.
- astine 12y agoWell, a lot of them then... I know that Arch and Gentoo at least use Bash and I'd be surprised if they were the only ones.
- profsnuggles 12y agoArch is using systemd and openrc comitted to using POSIX sh in their init scripts some time ago. So you can use dash or whatever posix compatible shell you want with it.
- vlad003 12y agoOn Ubuntu, since 6.10, Dash has been the default system shell rather than Bash. '/bin/sh' symlinks to '/bin/dash'.
- deleted 12y ago[deleted]
- felixgallo 12y agoYou've already been corrected with regard to the rest of your argument, but I'll correct you on the last part too: they could do so just fine. That's the power of a modular, non-tightly coupled system. Any script that uses ksh, zsh, bash, csh, tcl, lua, rc, whatever, runs fine under sysvinit.
- astine 12y agoNo, my point is that you cannot just take a script written for bash and run it on Zsh or Ksh and expect it to just work. (Well, sometimes you can, but that's beside the point.) Yes you can write your init scripts in whatever language you want, even Lisp or Python, but you have to do that for every daemon you switch over. Imagine a lot of these Linux distros which often implement their own init scripts for each program they support having to switch shells. That's hundreds of scripts to rewrite, or at least proofread and test.
- digi_owl 12y agoAnd nobody does that. They write for sh, that qll those others are compatible with. This means you can swap one part and expect things to work, rather than having to swap the whole engine because you want to swap one part.