[arch-general] dash as default shell?

brent s. bts at square-r00t.net
Wed Jun 17 19:58:04 UTC 2020

On 6/17/20 14:18, Piscium via arch-general wrote:
> ... A possible issue is bashisms, however Ubuntu has
> been using dash as default for 14 years and Debian also for several
> years so hopefully most scripts have had bashisms removed by
> upstreams.

This is false. Or at the least, grievously inaccurate.

Both Ubuntu and Debian use dash as the symlinked shell for /bin/sh, the
default *system shell*, NOT the interactive shell for users.[0][1]

Both continue to use bash as the default shell for the interactive shell
(user shell). Install the latest Ubuntu and/or Debian in a VM if you
don't believe me, but you'll see the same:

root at ubuntutest:~# lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04 LTS
Release:	20.04
Codename:	focal
root at ubuntutest:~# which $SHELL
root at ubuntutest:~# ls -l $SHELL
-rwxr-xr-x 1 root root 1183448 Feb 25 12:03 /bin/bash
root at ubuntutest:~# file $SHELL
/bin/bash: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV),
dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2,
BuildID[sha1]=a43fec47192ff49c2d3fed671f2be8df7e83784a, for GNU/Linux
3.2.0, stripped
root at ubuntutest:~# echo $SHELL

root at debian:~# lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 10 (buster)
Release:	10
Codename:	buster
root at debian:~# which $SHELL
root at debian:~# ls -l $SHELL
-rwxr-xr-x 1 root root 1168776 Apr 18  2019 /bin/bash
root at debian:~# file $SHELL
/bin/bash: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV),
dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for
GNU/Linux 3.2.0, BuildID[sha1]=ffe165dc81a64aea2b05beda07aeda8ad71f1e7c,
root at debian:~# echo $SHELL

In fact, Debian explicitly warns that dash is intended to NOT be used as
the interactive shell:

"It is not intended to be used interactively by a user, for example, in
a terminal emulator, but rather focuses on speed and compatibility with
standards. Therefore, many interactive features are not present in Dash,
making it faster and more memory efficient than Bash."[1]

It's faster *because they removed user features*.

[0] https://wiki.ubuntu.com/DashAsBinSh
[1] https://wiki.debian.org/Shell#Non-interactive_Shell

brent saner
GPG info: https://square-r00t.net/gpg-info

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 899 bytes
Desc: OpenPGP digital signature
URL: <https://lists.archlinux.org/pipermail/arch-general/attachments/20200617/f31ec0ab/attachment.sig>

More information about the arch-general mailing list