Redirection does not work in Solaris


 
Thread Tools Search this Thread
Operating Systems Solaris Redirection does not work in Solaris
# 1  
Old 12-26-2012
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
# 2  
Old 12-26-2012
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..
This User Gave Thanks to Scrutinizer For This Post:
# 3  
Old 12-26-2012
Thanks a LOT Scrutinizer!

It worked!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

grep -o does not work in Solaris

I am using the code below to grep through a list of files (TEMPFILE) and look for rsync, rdist, rsh, ftp, etc. in each file. Do a count of each, and output that to a logfile. This works great in Linux, but not at all in Solaris because the EGREP -o option does not exist. Anyone have an idea... (5 Replies)
Discussion started by: nitrobass24
5 Replies

2. Shell Programming and Scripting

Domain and work groups in solaris 10

Hello all, In solaris 10 can we create domains and workgroups like Active directory in windows? If that is possible, can some one please advise the procedure.. (1 Reply)
Discussion started by: bhargav90
1 Replies

3. Solaris

solaris redirection

Hi I am using solaris 10. When running a grep command with multiple files the output is the same as the order of the input. As soon as I pipe the output to another command then it seems that standard error takes precedence, over standard output and gets sent to the pipe first. ie grep -c... (7 Replies)
Discussion started by: chronics
7 Replies

4. Shell Programming and Scripting

Output redirection to exec does not work

Hello Experts, I am on Solaris 10 Due to some limitations in one of the vendor software, I am forced to output the command to exec and then run it from there. For example.. $(echo "/usr/bin/cp a.dat b.dat") # This works However, $(echo "/usr/bin/cat a.dat > c.dat") # This does not... (8 Replies)
Discussion started by: Gokul Kumar G
8 Replies

5. Solaris

grep -e doesn't work on solaris

grep -e doesn't work in Soalris. Same script with grep -e worked on AIX/HP/LINUX.. I would like to search a list of patterns on "log.txt" like ... grep -e FATAL -e ERROR log.txt I get the error message as grep: illegal option -- e Usage: grep -hblcnsviw pattern file . . . (3 Replies)
Discussion started by: jmkraja
3 Replies

6. Filesystems, Disks and Memory

HD Controller does not Work in Solaris

Hi, I'm attempting to build a raid Z NAS using solaris, but I only have 4 sata ports on my MB, so I bought a Rosewill RC-211 PCIe controller (adds 2 sata II ports). I'm new to solaris, but I understand that to add a new drive, you first run #devfsadm, which puts the files into /dev/dsk. I... (3 Replies)
Discussion started by: ciscocbee
3 Replies

7. Solaris

Need An Idea On How Solaris Work

PLS AM A NEWBE IN SOLARIS AND I NEED A GOOD MATERIAL ON HOW SOLARIS WORK.ie, THE INTERNAL WORKINGS OF SOLARIS. (2 Replies)
Discussion started by: dba
2 Replies

8. Shell Programming and Scripting

ls -d doesn't work on Solaris

Hello, the ls -d command to only list directories in a directory doesn't seem to work on Solaris and the man command says to use that combination: ls -d Anyone have the same problem and find a resolve? Thanks BobK (9 Replies)
Discussion started by: bobk544
9 Replies

9. UNIX for Dummies Questions & Answers

Mouse can not work in Solaris 10

Dear frends, My mouse in Solaris 10 machine has just failed today. The mouse itself is physically Ok, I can use it in my colleagues' Unix. In my own box, the cursor is just floating in the centre of screen. Any suggestions? Any method to check / modify hardware in solaris 10? thanks! (2 Replies)
Discussion started by: Dunhill_Zhao
2 Replies

10. Solaris

Mouse can not work in Solaris 10

Dear friends, My mouse can not work in my Solaris 10 machine. The mouse itself is OK, i can use it without problems in my colleagues' Unixs. I outstationed for a few weeks, after came back, it can not work already. The cursor will float in the centre of my screen and can never move,... (1 Reply)
Discussion started by: Dunhill_Zhao
1 Replies
Login or Register to Ask a Question