[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

A piping problem



I created a file: /usr/local/bin/printer.staircase.filter

This file consists of two lines:

#!perl
while(<STDIN>){chop $_; print "$_\r\n";};

I made it executable. It is owned by root.

This file is an attempt to write a filter to eliminate the staircase
effect (i.e. no CR after a LF) on my dot-matrix line printer.

The filter is supposed to put a CR LF at the end of every line.
(cf.: a perl manual)

I can give the command "less /usr/local/bin/printer.staircase.filer"
to bash, and get a listing of the file -- it really IS there.  

But when I try to pipe stuff into the filter with the following command
to bash  "cat mytextfile | /usr/local/bin/printer.staircase.filter | lpr"
I get the the following error report:

bash: /usr/local/bin/printer.staircase.filter: No such file or directory
lpr: stdin: empty input file

Can anyone explain why bash tells me the file is not there?

Note:   I am logged in as root for this operation, and all files 
involved are owned by root.

THANKS for your consideration

joeh



Reply to: