#! /bin/sh # RecodeMan - a useful shell script for recoding UTF-8 manpages to ISO-8859-1 # Posted by Denis Barbier on 26-Sep-2004, to the French CBLX ML: # # sect=$1 name=$2 orig="/usr/share/man/fr/man$sect/$name.$sect.gz" if ! test -f "$orig"; then echo "Le fichier /usr/share/man/fr/man$sect/$name.$sect.gz n'existe pas !" 1>&2 exit 1 fi temp=$(tempfile -p recman) if gunzip -c "$orig" | iconv -f UTF-8 -t ISO-8859-1 > "$temp" 2>/dev/null then gzip -c "$temp" > "$orig" rc=0 else echo "Cette page n'est pas en UTF-8, et n'est donc pas convertie." 1>&2 rc=2 fi rm -f "$temp" exit $rc