#!/bin/bash

if [ -z "$1" ]
then
  exit 1
fi

A=`which lpr`
if [ -z "$A" ]
then
  exit 1
fi

B=`which iconv`
if [ -z "$B" ]
then
  exit 1
fi

iconv -c -s -f CP866 -t UTF-8 $1 > $1.tmp
cat $1.tmp |lpr
rm -f $1.tmp
rm -f $1
