I'm BREAKING UP With Bash (Using dash as /bin/sh)

Опубликовано: 21 Октябрь 2022
на канале: Eric Murphy
5,839
164

Are you tired of having your shell scripts run by the slow, bloated bash? In this video, I'll show you how you can change your system shell (/bin/sh) to dash for minimal performance and security gains—and, more importantly, how to write better shell scripts that are portable, posix-compliant and usable by everyone, not just bash users.

Article on checking for Bashisms and testing with Dash: https://dev.to/bowmanjd/writing-bash-...
Dash article in the Arch Wiki: https://wiki.archlinux.org/title/Dash

Watch my videos on Odysee: https://odysee.com/@ericnmurphy
My website: https://ericmurphy.xyz
My GitHub: https://github.com/ericmurphyxyz

0:00 Intro
1:14 Differences between bash and dash
2:35 Installing dash
2:45 Checking /bin/sh scripts to remove bashisms
6:23 Making your scripts dash-compliant
7:40 Or just set bash scripts explicitly with /bin/bash
9:02 Using shellcheck for even more detail
10:00 Symlinking /bin/sh to dash
10:41 Relinking dash every time bash updates
11:45 Conclusion