sh2html is a shell wrapper and awk script, that formats a Bourne-compatible shell script into syntax highlighted HTML.
I decided to put this script together as I could find many syntax highlighting scripts/programs out there, but nothing for our humble friend sh!
The script should highlight most modern Bourne shell compliant syntax, as well as a few "common" external commands that are regularly called from shell scripts. It'd be impossible to include everything that's in everyone's PATH!
You can view the resulting output from running the formatter against
three scripts here; each one will open in a new window.
[ 1 ]
[ 2 ]
[ 3 ]
Download the script tarball here. As always, be sure to read the README before running! This script requires nawk, gawk or another extended-regex supportive awk!