Unix/Linux Go Back    


Solaris The Solaris Operating System, usually known simply as Solaris, is a Unix-based operating system introduced by Sun Microsystems. The Solaris OS is now owned by Oracle.

Redirection does not work in Solaris

Solaris


Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 12-26-2012
manalisharmabe manalisharmabe is offline
Registered User
 
Join Date: Jul 2011
Last Activity: 13 June 2014, 4:26 AM EDT
Posts: 159
Thanks: 103
Thanked 2 Times in 2 Posts
RedHat Redirection does not work in Solaris

Hi all,

i have been trying to direct o/p of one command to file, but i don get any entries in file but ouptput get displayed on command prompt.
I have tried many options but still , it does not work.
please guide.

here is the command


Code:
-bash-3.00$  /usr/local/bin/sudo lpstat -p | grep -i "not-found" 2> file11
Password:
Failed to get printer info for rmp_markpoint: not-found
Failed to get printer info for rp_rmp_fin_tst: not-found
Failed to get printer info for rp_rmp_pur_tst: not-found
Failed to get printer info for rp_rmp_hr_tst: not-found
Failed to get printer info for rp_rmp_muf_tst: not-found
Failed to get printer info for rp_itt_rac_tst: not-found
Failed to get printer info for rp_rmp_fie_7417dn: not-found

I see the output diplayed but nothig goes in file11.
remember "not-found" is error message.

please suggest me which option will do the same.

Thanks in advance.

Last edited by Scrutinizer; 12-26-2012 at 08:16 AM.. Reason: code tags
Sponsored Links
    #2  
Old Unix and Linux 12-26-2012
Scrutinizer's Unix or Linux Image
Scrutinizer Scrutinizer is offline Forum Staff  
Moderator
 
Join Date: Nov 2008
Last Activity: 31 July 2016, 2:14 AM EDT
Location: Amsterdam
Posts: 10,943
Thanks: 419
Thanked 3,008 Times in 2,674 Posts
The pipe only connects stdout not stderr..
Try:

Code:
/usr/local/bin/sudo lpstat -p 2>file11 | grep ...


Last edited by Scrutinizer; 12-26-2012 at 08:54 AM..
The Following User Says Thank You to Scrutinizer For This Useful Post:
manalisharmabe (12-26-2012)
Sponsored Links
    #3  
Old Unix and Linux 12-26-2012
manalisharmabe manalisharmabe is offline
Registered User
 
Join Date: Jul 2011
Last Activity: 13 June 2014, 4:26 AM EDT
Posts: 159
Thanks: 103
Thanked 2 Times in 2 Posts
Thanks a LOT Scrutinizer!

It worked!
Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
grep -o does not work in Solaris nitrobass24 Shell Programming and Scripting 5 07-31-2012 07:43 PM
solaris redirection chronics Solaris 7 06-04-2011 02:01 PM
Output redirection to exec does not work Gokul Kumar G Shell Programming and Scripting 8 05-25-2010 12:11 PM
Need An Idea On How Solaris Work dba Solaris 2 02-27-2008 10:55 AM
ls -d doesn't work on Solaris bobk544 Shell Programming and Scripting 9 08-27-2007 10:44 AM



All times are GMT -4. The time now is 05:25 AM.