Debugging bash scripts.
Ralf Mardorf
silver.bullet at zoho.com
Sat Feb 16 22:10:59 UTC 2019
On Sat, 2019-02-16 at 22:43 +0100, Oliver Grawert wrote:
> add "set -ex" to the top of your script
Indeed, "#!/bin/ [...]" at the beginning of a script allows to use kinda
"debugging" options, too.
IIRC
#!/bin/bash -ex
could be used instead of
#!/bin/bash
set -ex
I just wonder how this could be useful, if it's intended that a command
could either finish with exit status 0 or another status. Actually a
script is a set of rules to interact regarding different exit statuses
("statuses" wow, an English plural that hurts as hell).
More information about the ubuntu-users
mailing list