This document applies to AIX Versions 3.2.5 and 4.x.
Users wanted to use "expand -3" to expand tabs to three characters.
At AIX Version 4, testing indicates that one can simply add the expand command as a User Filter as follows:
Testing indicates that this process works fine. All tabs printed to this queue now print as 3 spaces when sent to a PostScript queue.
First, tests to add the expand command as an fc filter were done as follows:
When running expand as a filter using "fc=/usr/bin/expand -3", nothing prints to the printer.
This is included in the document only to show how looking at the pipeline with the -A2 flag can help resolve problems.
lsvirprt ia~v Changed line from: ' && BFLAG=" -b $PIOTITLE ";/usr/bin/enscript ' to ' && BFLAG=" -b $PIOTITLE ";/usr/bin/expand -3 | /usr/bin/enscript 'This seemed to print, but not change the file at all.
Printed with qprt -A2 -da -Pexpand tab.test This shows why the file is not changed. The pipeline shows:
test "$PIOTITLE" != /tmp/tab.test && BFLAG=" -b $PIOTITLE "; /usr/bin/expand -3 | /usr/bin/enscript -XISO8859-1 -p- -q -B $BFLAG -L66 -fCourier10 /tmp/tab.test | ....This shows that enscript is being passed the original file name to print.
Using lsvirprt with the ia~v (ia tilde v) subcommand to look at the attribute provides the following vi-like window to show the changes:
 'test "$PIOTITLE" !=  '
 %I@1          INCLUDE: (Path Name of File Being Printed)
 ' && BFLAG=" -b $PIOTITLE ";/usr/bin/expand -3 | /usr/bin/enscript '
 %?            <IF>
     %CX       PUSH: (1 If -X Flag on Command Line; Otherwise 0)
 %t            <THEN>
     %f[X]     For Each Flag x on Command Line: "-xArgument" -> OUTPUT
 %e            <ELSE>
     ' -X'
     %I_X      INCLUDE: (Code Page Name For Print Data Stream (file with same
               name in dir. "d1"))
 %;            <END>
The problem is nothing is being passed to expand, and then later
at the bottom of the ia attribute we find:
 %?            <IF>
     %L_f      PUSH: (Length of Attribute:  Single-Character BSD-type Filter
               Name (for example, "p" for "pr" filter))
 %t            <THEN>
 %e            <ELSE>
     ' '
     %I@1      INCLUDE: (Path Name of File Being Printed)
 %;            <END>
 ' | '
 %Iis          INCLUDE: (Pipeline for Input Data Stream "s" (PostScript))
This shows where enscript gets the filename to print.   This
means that when you send data through a filter, it should not
get the file name.  What is evident is that no file name
and no data are sent.
lsvirprt
    Choose Printer Queue
    ia~v
Move down below the top, long line to:
 'test "$PIOTITLE" !=  '
 %I@1          INCLUDE: (Path Name of File Being Printed)
 ' && BFLAG=" -b $PIOTITLE ";/usr/bin/enscript '
 %?            <IF>
     %CX       PUSH: (1 If -X Flag on Command Line; Otherwise 0)
 %t            <THEN>
Go to the line that shows:
Move to the bottom of the file (/tmp/expand:lpx.ia), still without leaving the vi session from ia~v.
Delete the lines that say:
 %?            <IF>
     %L_f      PUSH: (Length of Attribute:  Single-Character BSD-type Filter
               Name (for example, "p" for "pr" filter))
 %t            <THEN>
 %e            <ELSE>
     ' '
     %I@1      INCLUDE: (Path Name of File Being Printed)
 %;            <END>
Save the changes with :wq.  Back at the lsvirprt prompt reenter ia~v.
The lines should now read:
'test "$PIOTITLE" != ' %I@1 INCLUDE: (Path Name of File Being Printed) ' && BFLAG=" -b $PIOTITLE ";/usr/bin/expand -3 ' %I@1 INCLUDE: (Path Name of File Being Printed) ' | /usr/bin/enscript 'Note how the virtual printer added the explanation:
              INCLUDE: (Path Name of File Being Printed)
Exit the vi session and then the virtual printer. You should now be ready to print.