The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Error Message RDM00 UNIX for Dummies Questions & Answers 2 10-06-2006 03:43 PM
Error message ammu Shell Programming and Scripting 2 08-16-2006 04:41 AM
shell script: forbid extension Loriel UNIX for Dummies Questions & Answers 3 03-25-2004 01:47 PM
CSH Error Message Latha Nair Shell Programming and Scripting 6 10-22-2003 09:27 AM
How can I forbid a user to go up his home directory MarcoW UNIX for Advanced & Expert Users 2 10-04-2001 07:14 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 05-25-2005
ust ust is offline
Registered User
 

Join Date: Feb 2005
Posts: 95
forbid the error message

In my system , there is a script seems have a minor problem but I can't find it out , now everytime run the script , it will generate some error message to the system log , is it possible to forbid it generate the error to the system log or put all these message to /dev/null ? thx
Reply With Quote
Forum Sponsor
  #2  
Old 05-25-2005
zazzybob's Avatar
Registered Geek
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
in a bourne-type shell

my_script 2>/dev/null

in a c-type shell (this is a fudge)

( my_script > /dev/tty ) >& /dev/null

Cheers
ZB
Reply With Quote
  #3  
Old 05-25-2005
vino's Avatar
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,699
From your question I understand the following:

You dont want to display the error messages on the terminal. You either want it to go to the sys log or to /dev/null

This is way to put it to /dev/null

Say, a line in your script is

Code:
grep needle haystack
And you dont have the file haystack.

You would need this to redirect the error to /dev/null

Code:
grep needle haystack 2> /dev/null
Vino
Reply With Quote
  #4  
Old 05-25-2005
ust ust is offline
Registered User
 

Join Date: Feb 2005
Posts: 95
thx much for replies.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 05:02 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0