How to syntax check portable POSIX shell scripts? [duplicate]
问题 This question already has answers here : How do I syntax check a Bash script without running it? (8 answers) Closed 3 years ago . The following shell script executes well when provided /bin/true for the first argument, but may otherwise fail with a syntax error during execution! #!/bin/sh if $1 ; then exit; fi /tmp/asdf <<< ASDF # Something with syntax error in POSIX Surely some syntax errors (if not all?) can be avoided by static checking? How do I statically check whether a given Shell