forbid the error message


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting forbid the error message
# 1  
Old 05-25-2005
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
# 2  
Old 05-25-2005
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
# 3  
Old 05-25-2005
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
# 4  
Old 05-25-2005
thx much for replies.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. HP-UX

@ character forbid to write in vi.

Hi ALL, I'm encountering this problem on HP Shell (tcsh) environment. Once I enter in vi to edit a file and add my sql script, like this: sqlplus user/pass @promo.sql(tu run my script) the @ character is not possible to write. I push on the key but is not written inside. Also in sqlplus... (3 Replies)
Discussion started by: cicalons
3 Replies

2. Programming

How forbid use fork() in exec() program.

Hello World! I am writing code in C++ which have to launch another application X using exec(). I would like to set some limits on it using setrlimit etc... My problem is that i don't know how to forbid using fork() and strlimit by application X. How can i do it? (3 Replies)
Discussion started by: kzi
3 Replies

3. UNIX for Dummies Questions & Answers

forbid file recovery

Hi there, When I want to make a file unrecoverable, I use the following command: foo:~$ shred -fuz filename The problem is that I deleted many files using: foo:~$ rm -f filename How can I make those files unrecoverable? Is there a command that shreds the disk free space? So that no file can... (2 Replies)
Discussion started by: chebarbudo
2 Replies

4. Shell Programming and Scripting

Error message

I am new to scripting. I am using the following script . BART.dat contains the string 'Y' . #!/bin/ksh cd /work/TCI/data_out file=`cat BART.dat` echo "$file" if ; then echo "true" fi When i am executing the above script i am getting the following error ./s.ksh: : not found ... (2 Replies)
Discussion started by: ammu
2 Replies

5. UNIX for Dummies Questions & Answers

getting last error message

Question for unix programmers - what function I need to used to get the exact error message when the library failed to load? Thanks (1 Reply)
Discussion started by: tttttt
1 Replies

6. UNIX for Advanced & Expert Users

Error message

Hi, My Solaris 5.8 system keeps getting this error at boot - "Can't set vol root to /vol" then /usr/sbin/vold: can't set vol root to /vol: Resource temporarily unavailiable Any idea what is wrong, and how do I fix it? (1 Reply)
Discussion started by: ghuber
1 Replies

7. Solaris

Error message

Hi, My Solaris 5.8 system keeps getting this error at boot - "Can't set vol root to /vol" then /usr/sbin/vold: can't set vol root to /vol: Resource temporarily unavailiable Any idea what is wrong, and how do I fix it? (0 Replies)
Discussion started by: ghuber
0 Replies

8. UNIX for Dummies Questions & Answers

shell script: forbid extension

Rather new to unix, so please don't beat me! I'm trying to get a list of files into a variable that I can use throughout the rest of the script. The challenge is that I need to exclude a certain extension from the list, and I'm having trouble with it. For example: item_a item_a.exe... (3 Replies)
Discussion started by: Loriel
3 Replies

9. UNIX for Advanced & Expert Users

How can I forbid a user to go up his home directory

Hi everybody, How can I forbid a user to go up his home directory ? Thanks MarcoW (2 Replies)
Discussion started by: MarcoW
2 Replies
Login or Register to Ask a Question