In this week’s episode of Programming By Stealth, Bart Busschots starts building out one more tool in our toolbox: shell scripts. Bart starts with the basics explaining how to tell our little scripts which shell to run using the shebang line, the structure of shell scripts, commenting, assigning, and using variables, and how to write strings without having to escape every space and unusual character.
Throughout the installment, Bart refers back to things we learned in Taming the Terminal podcast and tutorial. If you haven’t listened to or read this series, you can download the book Helma helped us to produce using the Apple Books Store, or access it in a beautiful HTML version at ttt.bartificer.net/…, both of which have the audio of the podcast embedded within. You can find even more formats at podfeet.com/tttbook.
You can find Bart’s fabulous tutorial shownotes at pbs.bartificer.net.
Read an unedited, auto-generated transcript: CCATP_2023_01_07
5 thoughts on “CCATP #757 Bart Busschots on PBS 143 — Shell Script Basics”
Is there a webpage associated with this for the examples. Great podcast btw
Sorry about forgetting the link, Mark! I’ve instituted a TextExpander snippet to make sure I don’t forget but it was after I wrote this post. The link is above now but to make sure you see it, it’s: https://pbs.bartificer.net/pbs143
The format of the links might help: they’re all at pbs.bartificer.net and then / followed by pbs and the episode number.
Or you can always just go to pbs.bartificer.net and there’s a link list of every installment on the home page.
So glad you like the podcast!
I did it a completely mental way. To make it look like the output you were saying.
echo I like $dessert! ‘Pancakes have ‘ |perl -pe ‘chomp’;echo -n $dessert |wc -c |xargs|tr -d ‘\n’;echo ” letters”
Hey Bart, I switched from my mac to Linux and my one liner stopped working completely! Weirdly perl was throwing errors. Thanks for doing the show, it is awesome and I learn new things every time! I had to redo my super over complicated way. echo -n I like $desert! “$desert has “;echo -n $desert |wc -c |tr -d ‘\n’;echo ” characters in it”