Discussion Locked

Allow user view/ print report in Unix

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Currently we are running batch jobs that automatically report results to various printers in office. We would like to instead have output go to file and allow some a user ( easy understand, simple app) to receive msg, pull up file to review results, and then print it if necessary. This would help reduce waste of paper. Is there any app currently out there or an easy tech solution to solve this issue?

4 replies

by stillatit

If the unix app prints to standard output (most do), redirect the output to a file, then mail to the file to whichever users need it, or mail them a notice.

Look at how the command is written now. If you see something like:
myapp | lp
That isrouting the output of myapp to the lp (line print) program. (lpr is another line print program). Replace the pipe to line print with a redirect symbol ">" and the path and file name where the output is to go.

In a batch file, do something like this:

#
# the following line runs myapp and shoves the output in a file: /tmp/myoutfile
/usr/local/bin/myapp >/tmp/myoutfile
#
# the folowing line mails the output
/usr/bin/mail -s "Myapp output" groupname

by stillatit

Murphy strikes again! The line reading:
usr/bin/echo "Myapp output may be found in /tmp/myoutfile" /tmp/myout1
should read:
usr/bin/echo "Myapp output may be found in /tmp/myoutfile" > /tmp/myout1

This discussion is closed to new replies.