I have a bit of trouble with printing and wander how can I use TR or SED command to add carriage return at the end of line feed. I need to set this up as a pre-processing filter for all remote printers.
The sed command is a very useful command for filtering text files.
It can also be incorporated into the virtual printer as a filter
using the following method.
Setup:
Create a sed filter file that does what you want. In the first case
I have created one to remove all carriage returns from a file. I
call this file /usr/local/rmcr
vi /usr/local/rmcr and add
s/^M//g
Next modify the virtual printer using lsvirprt.
lsvirprt
Select the virtual printer to add the filter
Change the f attribute to point at the filter. This is done by
assigning f a single character that points at an attribute with
the file name
f=l
Now change the fl attribute to use the filter file that was
created earlier. I like to use fl~v to use a vi interface to
edit the attribute. Inside the vi session enter the following:
Command String for the "l" Filter.
fl = /usr/bin/sed -f /home/labs/aixtra/sed.ch
'/usr/bin/sed -f /usr/local/rmcr'
save and exit the vi session and exit lsvirprt.
Now print to the queue and the files should have cr removed, etc.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.