#!/bin/sh - # # Small script that prints German hyphenations for words. # # Oliver Fromme # BSD-style copyright and standard disclaimer applies. # # Note, this is a quick hack, and I've only tested it on # FreeBSD. You have to have a complete latex installed. # ME=`basename "$0"` case "$*" in -*|*\ -*) echo "Usage: $ME ..." >&2 echo "Prints German hyphenations for the words." >&2 exit 1 ;; esac umask 077 TMPDIR=/tmp/`basename "$0"`.`ps -auxww | md5`.tmp CleanUp() { rm -rf "$TMPDIR" exit 1 } trap CleanUp 1 2 3 15 mkdir -p "$TMPDIR" cd "$TMPDIR" cat <<-tac > showhyphen.tex \documentclass{article} \usepackage{german} \usepackage[T1]{fontenc} \usepackage[latin1]{inputenc} \begin{document} \showhyphens{$*} \end{document} tac if latex showhyphen.tex /dev/null 2>&1; then sed -n 's/^\[] \\[^ ]* //p' showhyphen.log | tr ' ' '\n' else echo "${ME}: Syntax error (don't use special characters)." >&2 rm -rf "$TMPDIR" exit 1 fi rm -rf "$TMPDIR" exit 0 #--