#!/bin/bash

FILE_PRINTED=$1
PRINTER="/dev/usb/lp0"

# echo "$FILE_PRINTED" >> /tmp/printing.log
# perl -pi -e 's/[^[:ascii:]]//g' $FILE_PRINTED

if [ -e "$PRINTER" ]; then
  while read line
  do
    echo "$line" > $PRINTER
  done < "$FILE_PRINTED"

  rm -rf $FILE_PRINTED
fi

