Linting and Improving Your Bash Scripts with ShellCheck

Publié le: 05 mai 2020
sur la chaîne: Nick Janetakis
2,339
66

ShellCheck helps you find subtle and obvious bugs / issues with your shells scripts.

Hit the subscribe button to receive more videos like this!

---

Timestamped table of contents:

0:00 -- What we'll cover in this video
1:20 -- Running ShellCheck against our broken script
1:59 -- Making sure your script has a shebang defined at the top of the file
2:34 -- Crawling through ShellCheck warnings one by one
3:18 -- You can only define local variables in a function with Bash, not POSIX shell
4:16 -- Help detect invalid commands by splitting variable references and assignments
5:48 -- If you want to interpolate variables, use double quotes not single quotes
7:34 -- Debugging an error and using ShellCheck's output to help fix a typo
9:15 -- Importance of splitting out your variable's reference and assignment
10:54 -- Ignoring a specific ShellCheck warning
12:10 -- ShellCheck is very nice to hook up with your continuous integration server
12:47 -- An example of using ShellCheck with Travis-CI for an open source project
13:56 -- I use ShellCheck all the time in my own scripts and it's easy to install
14:29 -- Messing around with https://shellcheck.net without having to install it locally

Reference links:

https://github.com/koalaman/shellcheck
https://shellcheck.net

---

Follow along?

Personal Website: https://nickjanetakis.com
Twitter:   / nickjanetakis  


Sur cette page du site, vous pouvez voir la vidéo en ligne Linting and Improving Your Bash Scripts with ShellCheck durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Nick Janetakis 05 mai 2020, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 2,339 fois et il a aimé 66 téléspectateurs. Bon visionnage!