diff options
author | jwinnie <jwinnie@tilde.institute> | 2021-11-29 21:11:03 -0500 |
---|---|---|
committer | jwinnie <jwinnie@tilde.institute> | 2021-11-29 21:11:03 -0500 |
commit | 0af52bf531c64f6b7d0c10bdbce8dc0cd9bf1661 (patch) | |
tree | bcc526c0f64bf2b67621f553ef2edafd2a8f7991 | |
parent | 94096519799fb245e3291869d1e1d199fa948338 (diff) | |
download | gmi2html-0af52bf531c64f6b7d0c10bdbce8dc0cd9bf1661.tar.gz |
Fix variable name conflict in AWK
-rwxr-xr-x | gmi2html.awk | 6 | ||||
-rwxr-xr-x | gmi2htmldir.sh | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/gmi2html.awk b/gmi2html.awk index 0193e6e..3092852 100755 --- a/gmi2html.awk +++ b/gmi2html.awk @@ -21,12 +21,12 @@ # $ awk -f gmi2html.awk \ # -v title=<title> \ # -v css=<css> \ -# -v url=<url> < path/to/gmi > path/to/html +# -v original=<original> < path/to/gmi > path/to/html # # parameters: # <title>: the title of the document, used in the HTML <title> # <css>: relative path to a CSS stylesheet -# <url>: URL of the original Gemini document, linked in the footer +# <original>: URL of the original Gemini document, linked in the footer # Begin HTML document BEGIN { @@ -174,5 +174,5 @@ Also available on <a href=\"gemini://%s\">Gemini</a>\ </small>\ </footer>\ </body>\ -</html>", url +</html>", original } diff --git a/gmi2htmldir.sh b/gmi2htmldir.sh index 42babfb..2a20673 100755 --- a/gmi2htmldir.sh +++ b/gmi2htmldir.sh @@ -18,19 +18,19 @@ # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # usage: -# $ ./gmi2htmldir.sh <in> <out> title=<title> css=<css> url=<url> +# $ ./gmi2htmldir.sh <in> <out> title=<title> css=<css> original=<original> # # parameters: # <in>: the folder of Gemini files to be converted # <out>: the folder in which to put the generated HTML files -# <title>, <css>, <url>: parameters passed to gmi2html.awk; see gmi2html.awk for more details +# <title>, <css>, <original>: parameters passed to gmi2html.awk; see gmi2html.awk for more details # in=$1 out=$2 title=$3 css=$4 -url=$5 +original=$5 gmi2html=${PWD}/$(dirname $0)/gmi2html.awk @@ -38,5 +38,5 @@ cd $in for f in *.gmi **/*.gmi; do HTML_FILENAME=$out/${f%.gmi}.html echo "processing: ${f} -> ${HTML_FILENAME}" - awk -f $gmi2html -v $title -v $css -v $url < $f > $HTML_FILENAME + awk -f $gmi2html -v $title -v $css -v $original < $f > $HTML_FILENAME done |