texmf-dist/doc/latex/shdoc/shreformat.sh
raw| 1 | #!/bin/bash |
| 2 | |
| 3 | # experimental formatting script to pre-format shell output that is read by |
| 4 | # the LaTeX package 'shdoc' (see ctan.org/pkg/shdoc) |
| 5 | |
| 6 | # 1. read from shrun.tmp and substitute double tabs with two spaces |
| 7 | # 2. substitute single tabs with single spaces |
| 8 | # 3. remove all leading spaces and save the output to shrun-formatted.tmp |
| 9 | sed 's/\t\t/ /' <shrun.tmp | sed 's/\t/ /' | sed -e 's/^[ \t]*//' >shrun-formatted.tmp |