diff options
author | John Ankarström <john@ankarstrom.se> | 2020-12-01 00:16:11 +0100 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2020-12-01 00:16:11 +0100 |
commit | 18d7985f0a6dbc2032a05c10395e3e7d6fd511ee (patch) | |
tree | ce8f8f037001d5ebc4f11276c3dd862485f2499a /hwrap | |
parent | 1511fba8e989df3dcdb4f6253e6c696a2e1944b7 (diff) | |
download | mht-18d7985f0a6dbc2032a05c10395e3e7d6fd511ee.tar.gz |
Add 'hwrap' tool
hwrap is a simple shell script that wraps the text read on standard
input in an <html> tag.
This could be built into the mh script, but I think it's more UNIX-like
this way.
Diffstat (limited to 'hwrap')
-rwxr-xr-x | hwrap | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -0,0 +1,21 @@ +#!/bin/sh + +# hwrap -- wrap in <html> tag + +l= +while getopts l: o; do + case $o in + l) l=$OPTARG ;; + ?) echo usage: $0 [-l LANG] 1>&2; exit 1 ;; + esac +done +shift $((OPTIND-1)) + +if test -z "$l" +then echo '<html>' +else echo "<html lang=\"$l\">" +fi + +cat + +echo '</html>' |