#!/bin/sh while read line ; do echo $line | perl -p -e 's/^\&(.*)-$/\+$1/' | iconv -f utf-7 -t koi8-r done