Considering today’s advent of CI and CD (Continuous Integration and Continuous Development),
shell programming is still a thing and is still hard*1,
shellcheck is a tool that can save you
r life a lot of time.
sudo apt-get -y install shellcheck
Search the SCXXXX code in your favorite search engine, it will direct you to the
shellcheck’s wiki with the full explanation and some advice for fixing the code. example:
test.sh sample file:
#!/bin/bash echo $0
shellcheck test.sh In test.sh line 2: echo $0 ^-- SC2086: Double quote to prevent globbing and word splitting.