HNHacker News
TopNewBestAskShowJobs

pottmi

12 karma · joined April 17, 2025

submissionscomments
pottmi··on Advanced Shell Scripting with Bash (2006) [pdf]
I switched to zsh so I have not been paying attention to bash so I don't have a top three things to add. I just add things as I stumble on them.

Thanks for the tip on reference variables. definitely better than eval. i will add that to the presentation.

I will look into using set -u and what I can do with that and add it to the presentation. Perhaps make a companion presentation on debugging bash.

Another good presentation would be on how to use bash safely with sudo. I have a sudo presentation that is pretty good for it is for sudo 1.7 and the current version is 1.9 so I would need to update it before giving it.

I have not used associative arrays in bash. I would probably tend to use python if i needed that capability so I am not likely to use aa in bash soon.

Regarding nesting levels of self modifying variables: Yeah, I tried to do it once and failed and did not try to figure out any tricks to get it to work. I just moved to multiline which is easier to debug and comment on for the poor bastard that has to fix my code.

pottmi··on Advanced Shell Scripting with Bash (2006) [pdf]
It is what I advise people that want to make a presentation to give to their local LUG. Do the presentation on something "evergreen" that will last a long time. File permission, regular expression, /proc file system, ... Dig into the details and anytime you are surprised by something make a new slide. Also make "Cookbook" slides. pretty soon you have 30 slides and it is enough for a full presentation.
pottmi··on Advanced Shell Scripting with Bash (2006) [pdf]
Yeah, despite having created that presentation and having given it 50 times if I were to do another IBM JCL to shell conversion I would convert to zsh.
pottmi··on Advanced Shell Scripting with Bash (2006) [pdf]
You will like the final version of the traperr ERR function. It looks to create a "stack trace" type dump of where you are in the script when it fails.

See it here: https://github.com/pottmi/stringent.sh

pottmi··on Advanced Shell Scripting with Bash (2006) [pdf]
Here is a https link to the presentation and the stringent.sh library:

https://github.com/pottmi/stringent.sh

pottmi··on Advanced Shell Scripting with Bash (2006) [pdf]
It is not how to code in bash, it is how to avoid the bash pitfalls.
pottmi··on Advanced Shell Scripting with Bash (2006) [pdf]
I contacted the guys that run the site and asked them to add https.

I will throw the pdf on my gitlab account that has the stringent.sh script.

https://github.com/pottmi/stringent.sh

pottmi··on Advanced Shell Scripting with Bash (2006) [pdf]
It was done in keynote on a mac in 2006. I still maintain the 2025 version in keynote on a mac.
pottmi··on Advanced Shell Scripting with Bash (2006) [pdf]
Are you bashing bash?
pottmi··on Advanced Shell Scripting with Bash (2006) [pdf]
I am the author of this presentation. Feel free to ask me questions and send me corrections to the pdf and youtube video.

Here is are the slides: http://uniforumchicago.org/slides/bash_2025-03-25.pdf

Here is the recording of the video: https://www.youtube.com/watch?v=DvDu8_A2uhs

Here is the stringent.sh library that is shown in the presentation: https://github.com/pottmi/stringent.sh