3 ms·
> I've never used a shell that doesn't understand [[ That may be, but that doesn't mean they aren't pretty widespread. [[ and {,} are bashisms. However, they s
by nandhp 13y ago
> I've never used a shell that doesn't understand [[
That may be, but that doesn't mean they aren't pretty widespread. [[ and {,} are bashisms. However, they still work when bash is executed as /bin/sh, as is the case on RedHat and some other Linux distributions.
However, other distributions, including Debian, Ubuntu, and any embedded system using Busybox, point the /bin/sh symlink to a version of ash, the Almquist shell. It is used for scripts instead of bash because it is much smaller and faster (reportedly, Debian/Ubuntu boot speed improved significantly -- leaving the shell isn't a very good option for sysvinit).
- emmelaich 13y ago[[ is from ksh88 or earlier; {,} is apparently from csh. (Funny; I could've sworn I used {} in ksh under Solaris but apparently not!) Your point stands though, they are bashisms for all intents and purposes on Linux. As to speed -- well, again, I think if you want speed don't use shell. For startup you're better off redesigning the whole damn thing (cue systemd). Changing shell is like overclocking your cpu when you should be choosing a better algorithm.