programming in bash is great
I started programming CLI tools/applications in bash yesterday. Normally, I make small bash scripts to help run files. I actually kind of like it over Node.js. Instead of using the (annoying) HTTP module or the node-fetch package, I can do something like this:
bash
HTML=$(curl https://example.com)
echo HTML
Bash can be a bit annoying to learn, for example, date formatting. I’ve never used the date command before, so instead of typing:
js
new Date();
// Tue Mar 09 2021 12:21:59 GMT-0500 (Eastern Standard Time)
You need to run
date +"%B %d, %Y (%r)"
Which outputs:
March 09, 2021 (12:21:03 PM)
Yeah I know, “big deal buddy” but seriously, It can be annoying.
Althogh, I do like the fact that I don’t need something like moment.js to format dates
I also like the fact that I don’t need to require a package like readline or inquirer to get user input:
bash
echo "Yo! What's your name?"
READ name
echo "Welcome $name!"
Well, thanks for reading, bye!