Writing Robust Bash Scripts

Writing Robust Bash Scripts

Linux Foundation via YouTube Direct link

Exit your scripts with an explicit exit (n 0) on any non-normal exit

9 of 10

9 of 10

Exit your scripts with an explicit exit (n 0) on any non-normal exit

Class Central Classrooms beta

YouTube videos curated by Class Central.

Classroom Contents

Writing Robust Bash Scripts

Automatically move to the next video in the Classroom when playback concludes

  1. 1 S OPIN SOURCE SUMMIT Writing Robust Bash Scripts
  2. 2 What can go wrong here?
  3. 3 Choose a shebang (#!) carefully ...
  4. 4 If you are coding in bash then use the bash shebang
  5. 5 If you want to create a POSIX script use 'checkbashisms' script to check your script for bashisms
  6. 6 Use set -o pipefail
  7. 7 Use local for variables in functions Variables in bash have global scope
  8. 8 Cron Jobs: "SILENCE IS GOLDEN" What can go wrong with the following code if the script triggers errors that are not redirected properly?
  9. 9 Exit your scripts with an explicit exit (n 0) on any non-normal exit
  10. 10 Use www.shellcheck.net Shell Script analysis tool

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.