Debian Almquist Shell có gì hay hơn Bash shell?

Debian Almquist Shell là shell tuân theo chuẩn POSIX có nguồn gốc từ Ash shell.

Debian Almquist Shell thường viết tắt là dash.

# apt info dash
Package: dash
Version: 0.5.11+git20210903+057cd650a4ed-3build1
Priority: required
Essential: yes
Section: shells
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Andrej Shadura <andrewsh@debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 219 kB
Pre-Depends: libc6 (>= 2.34)
Depends: debianutils (>= 2.15), dpkg (>= 1.19.1), debconf (>= 0.5) | debconf-2.0
Homepage: http://gondor.apana.org.au/~herbert/dash/
Task: minimal
Download-Size: 92,0 kB
APT-Manual-Installed: yes
APT-Sources: http://vn.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
Description: POSIX-compliant shell
 The Debian Almquist Shell (dash) is a POSIX-compliant shell derived
 from ash.
 .
 Since it executes scripts faster than bash, and has fewer library
 dependencies (making it more robust against software or hardware
 failures), it is used as the default system shell on Debian systems.

Dash shell chạy các script nhanh hơn Bash shell và phụ thuộc vào ít thư viện hơn Bash shell nên nó là shell mặc định trên Debian.

# ll `which sh`
lrwxrwxrwx 1 root root 4 Thg 12  2 17:25 /usr/bin/sh -> dash*

# cat /etc/os-release 
PRETTY_NAME="Ubuntu 22.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.3 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

Dash shell theo mô tả trên Rocky Linux là shell tuân theo chuẩn POSIX chạy file /bin/sh với mục tiêu càng mi nhon càng tốt.

Dash shell làm được các công việc nặng nề mà không hi sinh tốc độ chạy. Thật ra nó nhanh đáng kể so với Bash shell trong hầu hết các công việc.

# yum info dash
Available Packages
Name         : dash
Version      : 0.5.11.5
Release      : 4.el9
Architecture : x86_64
Size         : 97 k
Source       : dash-0.5.11.5-4.el9.src.rpm
Repository   : epel
Summary      : Small and fast POSIX-compliant shell
URL          : http://gondor.apana.org.au/~herbert/dash/
License      : BSD-3-Clause AND GPL-2.0-or-later AND LicenseRef-Fedora-Public-Domain
Description  : DASH is a POSIX-compliant implementation of /bin/sh that aims to be as small as
             : possible. It does this without sacrificing speed where possible. In fact, it is
             : significantly faster than bash (the GNU Bourne-Again SHell) for most tasks.

Dash shell không phải là shell mặc định trên Rocky Linux 9.

# ll `which sh`
lrwxrwxrwx. 1 root root 4 Jan 24  2023 /usr/bin/sh -> bash

# cat /etc/os-release
NAME="Rocky Linux"
VERSION="9.3 (Blue Onyx)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="9.3"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Rocky Linux 9.3 (Blue Onyx)"
ANSI_COLOR="0;32"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:rocky:rocky:9::baseos"
HOME_URL="https://rockylinux.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
SUPPORT_END="2032-05-31"
ROCKY_SUPPORT_PRODUCT="Rocky-Linux-9"
ROCKY_SUPPORT_PRODUCT_VERSION="9.3"
REDHAT_SUPPORT_PRODUCT="Rocky Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.3"