Newsletter #37 - Shells and My New Video Course Nov 2 2023
Hello, and welcome to issue #37!
I've been thinking about the age old disputes between engineers. Everyone has a preference on how the world should work. Some people prefer Chrome, others FireFox. Some people prefer vim, others are wrong. You know what I mean, there are fans and there are FANS.
Way back when, when I was a young lad who enjoyed listening to the sound of my 56k-modem attempting to connect to the "Information Superhighway". That is what the Internet was called back then, for the uninitiated. There was one such debate, "should you use bash or should you use zsh?"
There were many arguments in favor or against each other. Some didn't age that well. For example, "Bash has been under development for longer, why would you ZSH it is new and full of bugs". To give more context, Bash was released in 1989 and ZSH was realeaded in 1990. Yup, Bash is 34 years old and zsh is 33. You can say both are very mature projects.
I do have a preference for bash, and I can give you some compelling reasons why you should too.
We can ignore the syntax, and customization. Those are just a matter of preference. The points I believe are more relevant are:
- Availability: I've found bash pre-installed in many more servers than ZSH.
- Knowledge transfer: Most shell scripts are either in
sh
or inbash
, so your knowledge of bash will also apply to shell-scripting. - Readline input library: Bash uses the readline library to handle input,
zsh
uses its own. Many more projects use readline (e.g. the Python CLI, SQLite, nftables, many more), so we have more knowledge transfer again.
Those items would make it more appealing. But there is one key element that we haven't considered. The fact that now, zsh
, is prepackaged in macOS as the default shell.
I made a poll on reddit, and the results where 195 votes for bash
, 202 for zsh
.
That was interesting. I was expecting it to be a clear winner. So I checked Google Search terms (2004 to date). The results were what I expected, there are about [10.75 times more interest in bash than in zsh.
The lesson to take away from this is not that statistics is hard and more akin to black magic. Instead, it is a reminder that our assumptions are wrong most of the time, even when we have evidence. Truth is seldom absolute, it is often relative. Depending on where you go collect your evidence, you might get a biased response. In my case, it is very possible that most of Reddit's users are Apple users, so they are probably going to lean towards using the shell that comes pre-installed (or that has more flashy features).
So, the next time that you are in an argument and you believe that you are right, always leave some room for the possibility of you being wrong.
Recommendations and interesting topics
I've created a video course:
Bash Beyond Basics - Increase your efficiency and understanding of the shell
The link includes a 20% discount, only for newsletter subscribers! Thanks for subscribing to my work. I really believe this course will be useful for you, take a look and let me know what you think.
Short-documentaries: I've been enjoying the short tech-related documentaries posted by Honeypot. Take a look at their Youtube Channel, you'll probably find something you enjoy.
Podcast recommendation: This one is a little bit mainstream but I believe you'll enjoy it. Tim Ferriss - Apollo Robbins, The World's most famous Pickpocket. I've always been fascinated by pickpockets, the skill not the trade. Also, its safer cousin, sleight of hand tricks. It was a fun listen, Apollo mentions many books during the interview, it would be interesting to take a look at a few of them.
Audiobook recommendation: I've been enjoying the "He Who Fights with Monsters" series. If you are into LitRPG adventures you might like it.
OK, that's it for this issue of the newsletter. Thanks for reading and until next time!
Derik
Tip of the week
This week we have a fun one that is part of the video course. cd -
. If you ever find yourself jumping between directories, or you just want to go back to the directory you were before, try cd -
. For example:
1
2
3
4
5
6
7
$ cd ~/projects/super_secret_project/
$ vi main.c
$ cd /etc/cron.d/
$ cd -
# it will take you back to the last working directory
$ pwd
~/projects/super_secret_project