Skip to content

Instantly share code, notes, and snippets.

Created July 3, 2017 18:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/55d0338ba6c7947cf44ad13079ab844d to your computer and use it in GitHub Desktop.
Save anonymous/55d0338ba6c7947cf44ad13079ab844d to your computer and use it in GitHub Desktop.
get_wiki_handbook
#!/bin/bash
# Quick hack to generate handbook.txt from pmwiki
# Johannes Winkelmann, jw at tks6 dot net
INFILE=handbook.in
OUTFILE=handbook.txt
CRUX_VERSION=3.3
TITLE="HANDBOOK FOR CRUX $CRUX_VERSION"
URL="http://crux.nu/Main/Handbook${CRUX_VERSION/\./-}?action=print"
set -x
links -no-numbering -no-references -dump $URL > $INFILE
cat $INFILE|while read n; do
if [ -n "$intext" ]; then
cat
elif [ "$n" = "1. Preface" ]; then
echo "$TITLE"
echo "";
echo " $n";
intext="yes";
fi
done > $OUTFILE
rm $INFILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment