summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/shdoc/shreformat.sh
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/latex/shdoc/shreformat.sh')
-rwxr-xr-xMaster/texmf-dist/doc/latex/shdoc/shreformat.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/shdoc/shreformat.sh b/Master/texmf-dist/doc/latex/shdoc/shreformat.sh
new file mode 100755
index 00000000000..d27e9c088d8
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/shdoc/shreformat.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+# experimental formatting script to pre-format shell output that is read by
+# the LaTeX package 'shdoc' (see ctan.org/pkg/shdoc)
+
+# 1. read from shrun.tmp and substitute double tabs with two spaces
+# 2. substitute single tabs with a single space
+# 3. remove all leading spaces and save the output to shrun-formatted.tmp
+sed 's/\t\t/ /' <shrun.tmp | sed 's/\t/ /' | sed -e 's/^[ \t]*//' >shrun-formatted.tmp