Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print Job Number and actual file 1

Status
Not open for further replies.

AlbertAguirre

Programmer
Nov 21, 2001
273
US
I would like to find a way to link a print job number to the actualy file created in /var/spool/qdaemon

How can this be done?




 
Code:
for job in /var/spool/qdaemon/*
do
num=`grep -l $job /var/spool/lpd/qdir/* 2>/dev/null| xargs head -1`
if [[ "$num" -ne "" ]]
then
print "$job: $num"
fi
done

The number printed is the true print job number. You can use it directly, but the rightmost three numbers will work by themselves.

Rod Knowlton
IBM Certified Advanced Technical Expert pSeries and AIX 5L
CompTIA Linux+
CompTIA Security+

 
I was looking for a UNIX command that would give me the info but this will work.

Thanks!

-Albert
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top