@@ -1,26 +0,0 @@
1−#!/bin/bash
2−
3−# iterates recursively over specified directory, tries to convert
4−# man pages and prints to stderr on errors.
5−
6−# if called with two arguments, the first is the path to pandoc,
7−# and the second is the directory. if with one argument, it
8−# is the directory, and pandoc is used from path.
9−
10−if [ $# -eq 2 ]; then
11− PANDOC=$1
12− DIR=$2
13−elif [ $# -eq 1 ]; then
14− PANDOC=pandoc
15− DIR=$1
16−else
17− echo "Not enough arguments"
18− exit 1
19−fi
20−
21−$PANDOC --version > /dev/null || { echo "pandoc executable error" >&2 ; exit 1 ; }
22−
23−for f in `find "$DIR" -name '*.[0-9]'`; do
24− ( iconv -f utf8 -t utf8 $f 2>/dev/null || iconv -f latin1 -t utf8 $f ) | \
25− $PANDOC --resource-path "$DIR":"$(dirname $f)" -f man -o /dev/null || echo "Failed to convert $f"
26−done