Monday, 12 August 2013

How do I check a bash script without running the script?

How do I check a bash script without running the script?

How do i check for errors (and maybe warnings) in a bash script?
I want to precheck bash scripts before checking them into a git repository.
I know I can use bash -n script.sh for a first, simple check but this
doen't find for example things like rewriting on a readonly string.
readonly unique_id = "42"
unique_id = "21"
will be ok for a bash -n script.sh but will fail on execution of course.

No comments:

Post a Comment