LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-02-2004, 08:08 PM   #1
RickMean
LQ Newbie
 
Registered: Sep 2004
Posts: 3

Rep: Reputation: 0
Question Any one know how to redirect standard error (stderr) to a JetDirect printer?


I have configured a JetDirect printer using "Printer Configuration" on a RedHat Linux 7.3. I have no problem issuing the lp command,i.e,'lp foo.txt', or 'echo "Test text"|lp'. I have not figure out how to redirect stderr to the printer. I would like to print stderr from my program to the dedicated JetDirect printer. Example in a C/C++ program, fprintf(stderr, "Error: failed print to JetDirect"). This won't work: "foo_program 2> /dev/lp0" because it is not a local printer. Any suggestion?
 
Old 09-03-2004, 06:40 AM   #2
amf57
LQ Newbie
 
Registered: Feb 2003
Posts: 22

Rep: Reputation: 15
Can you just redirect your error to a file and print that?

ls -z 2>err;lp err; rm -f err

I know this isn't what you are looking for, but you can't pipe the error to lp. This will work until something can be figured out.
 
Old 09-03-2004, 11:33 AM   #3
RickMean
LQ Newbie
 
Registered: Sep 2004
Posts: 3

Original Poster
Rep: Reputation: 0
The only problem is my program has to keep running until a kill signal is issued. I think I should stick with the local printer option until further notice. Thanks for the suggestion, amf57.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
TCSH: redirect stdout and stderr seperately ugenn Linux - General 3 02-07-2016 03:23 PM
Printer Configuration: "Print file sent, waiting for printer to finish", JetDirect Ed-MtnBiker Fedora 3 02-23-2007 12:41 PM
redhat jetdirect printer contiang Linux - General 0 12-12-2004 08:59 PM
how do i redirect stderr to a file? nodger Programming 5 11-28-2004 11:22 AM
How to redirect standard output of piped command to log file andrewstr Linux - General 10 02-04-2004 02:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration