Redirection does not work in Solaris | Unix Linux Forums | Solaris

  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    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 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 09:16 AM.. Reason: code tags
Sponsored Links
    #2  
Old 12-26-2012
Scrutinizer's Avatar
Scrutinizer Scrutinizer is offline Forum Staff  
Moderator
 
Join Date: Nov 2008
Last Activity: 26 November 2014, 7:31 PM EST
Location: Amsterdam
Posts: 9,616
Thanks: 293
Thanked 2,452 Times in 2,200 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 09:54 AM..
The Following User Says Thank You to Scrutinizer For This Useful Post:
manalisharmabe (12-26-2012)
Sponsored Links
    #3  
Old 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

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 08:43 PM
solaris redirection chronics Solaris 7 06-04-2011 03:01 PM
Output redirection to exec does not work Gokul Kumar G Shell Programming and Scripting 8 05-25-2010 01:11 PM
Need An Idea On How Solaris Work dba Solaris 2 02-27-2008 11:55 AM
ls -d doesn't work on Solaris bobk544 Shell Programming and Scripting 9 08-27-2007 11:44 AM



All times are GMT -4. The time now is 10:36 PM.