MENU

Fun & Interesting

Learning Bash Best Practices - 01 // Stopping script on error and using getopts

The Mouseless Dev 3,652 lượt xem 3 years ago
Video Not Working? Fix It Now

We look at different options we can set to improve Bash error handling, how to add options to a command dynamically, and how to use getopts to pass options to our scripts.

Starting script: https://github.com/Phantas0s/mouseless-dev-youtube/blob/master/bash_best_practice/backup_v1.sh

Ending script: https://github.com/Phantas0s/mouseless-dev-youtube/blob/master/bash_best_practice/backup_v2.sh

I'm using Vim with shellcheck for static analysis. For snippets, ultisnips is my friend.

📙 Building Your Mouseless Development Environment: https://themouseless.dev
📑 Learning to Play Vim: https://themouseless.dev/vim

💎 Increase your value as a developer: https://thevaluable.dev

🐙 Github: https://github.com/Phantas0s
🍒 Support the channel: https://github.com/sponsors/Phantas0s

Comment