Home » Shell Scripting » BASH » Effective Bash scripting for software developers

About Sebastian Daschner

Sebastian Daschner
Sebastian Daschner is a self-employed Java consultant and trainer. He is the author of the book 'Architecting Modern Java EE Applications'. Sebastian is a Java Champion, Oracle Developer Champion and JavaOne Rockstar.

Effective Bash scripting for software developers

I’ve been asked many times about my shell scripts and things I’ve automated, as I’ve recently shown in a video about things I’ve automated on my system. I’ve created another video on how to effectively write Bash scripts for regular developers, who aren’t experienced on the sysadmin side of things.

First and foremost, I wouldn’t consider myself a shell scripting expert, but there are so many pragmatic and effective things that make our lives easier, that it would be a shame to not use the power of the command line and its possibility to automate things on our system.

In the video I’m sharing some Bash scripting examples and tips that will hopefully improve your scripts. You can find a full example script to copy-and-paste from on GitHub.

In the video I’m showing:

  • set -euo pipefail option
  • Navigating to the script’s location with cd ${0%/*}
  • Using Bash traps
  • test command
  • xargs, piping, and loops
  • Number formatting with leading zeros
  • Waiting and health checks
  • Handling PID files

Further resources

Published on System Code Geeks with permission by Sebastian Daschner, partner at our SCG program. See the original article here: Effective Bash scripting for software developers (Video)

Opinions expressed by System Code Geeks contributors are their own.

(0 rating, 0 votes)
You need to be a registered member to rate this.
Start the discussion Views Tweet it!
Do you want to know how to develop your skillset to become a sysadmin Rockstar?
Subscribe to our newsletter to start Rocking right now!
To get you started we give you our best selling eBooks for FREE!
1. Introduction to NGINX
2. Apache HTTP Server Cookbook
3. VirtualBox Essentials
4. Nagios Monitoring Cookbook
5. Linux BASH Programming Cookbook
6. Postgresql Database Tutorial
and many more ....
I agree to the Terms and Privacy Policy
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments