How to print specific output only, ie, %.lis - only

Document ID : KB000089821
Last Modified Date : 14/04/2018
Show Technical Document Details
Issue:
How to print specific output only, ie, %.lis - only
Resolution:

Symptoms

When trying to send specific files to your printer only you end up getting al output files as well as the ones you wish to print(i.e. .lis files).


Cause

You need to set up the script on your output device to specifically print only these files.


Resolution

You can set up the output interface for your output device using the following:

ext=`echo $1|cut -f2 -d"."`
if [ "$ext" = "lis" ]; then
  exit 0
fi

This will print just the .lis files


If they want something more dynamic, they could add a parameter to the Output Device Interface and pass a regular expression.
On Unix there is a "expr" command that can evaluate expressions.
 
Example Match: it returns zero.
expr /opt/uc4/test.txt : ".*\.txt"
echo $?
0
 
Example No Match: it returns one.
expr /opt/uc4/test.txt : ".*\.lis"
echo $?
1