POSIX shell
medium risk
On Debian/Ubuntu sh is dash; on RHEL it is bash in POSIX mode. Bash-only syntax ([[ ]], arrays) fails.
| Flag | Meaning |
|---|---|
-c | Run a command string |
-x | Trace |
-n | Syntax check |
sh -n script.shCheck syntax · explain & risk-check →sh -c "echo $0" testRun a string · explain & risk-check →Reference text is hand-written and may be incomplete — check man sh for your version. Test destructive commands on a non-production system first.