2 ms·
Oh yes. Bash is definitely not a good general purpose programming langauge, hell I'd hesitate to even call it a programming language. However, it's very much so
by Sir_Cmpwn 10y ago
Oh yes. Bash is definitely not a good general purpose programming langauge, hell I'd hesitate to even call it a programming language. However, it's very much so the right tool for the job in an initramfs. How familiar are you with the early boot process on a modern Linux distro? Ever had to do it manually from an initramfs rescue shell? Well, if not, it basically just involes invoking a bunch of commands and minimal parsing. Most early boot configs like /etc/fstab are easily readable with awk and are well suited to handling with shell scripts. All you basically have is a stripped down userspace with coreutils plus the commands necessary to prepare the system for the full boot. Shell scripts are the natural choice for tying it all together. I actually really like bash in general, in the niches it's suited for it's very nice.