Eliminate error message (/dev/null)?

Thread Tools Search this Thread
# 1  
Eliminate error message (/dev/null)?

I am trying to eliminate an error message from a script. This is the error message:

find: stat() error /usr/openv/netbackup/db/images/KUMAX: No such file or directory

if [[ -n "$new3" && -n "$uppervarn3" ]];
  runthiscommand=`su nxadm -c "ssh -t $new3 exec /bin/sh -s">/tmp/filew3 2>/tmp/error.txt<<EOF
                /usr/openv/netbackup/bin/bplist -C $uppervarn3 -t 13 -l -R $rec -s $startdate -e $enddate $pathoffiles

This error message is not of concern to me in that part of my script does pick up the correct directory. But because there is only a lowercase kumax directory and no KUMAX uppercase, when it goes to run the command to check the uppercase, it sends an error message because the upper case directory does not exist. I am trying to find out only how to eliminate the find (stat) error message. I've tried 2>/tmp/error.txt, /dev/null and other methods, and none of these works. Does anyone have experience eliminating error messages from scripts? Thanks in advance.

Last edited by jim mcnamara; 01-03-2013 at 12:08 PM.. Reason: Code tags
# 2  
Have you tried it this way:

$ stat error /usr/openv/netbackup/db/images/KUMAX
stat: cannot stat `error': No such file or directory
stat: cannot stat `/usr/openv/netbackup/db/images/KUMAX': No such file or directory

$ stat error /usr/openv/netbackup/db/images/KUMAX 2>/dev/null
*** Nothing is output(i.e error message sent to bit bucket)


Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Find Null values in Columns and fail execution by displaying error message

Hi All, I am new to shell scripting. I have a requirement as part of my job to find out null/empty values in column 2 and column 3 from a CSV file and exit the further execution of script by displaying a simple error message. I have developed a script to do this by reading various articles... (7 Replies)
Discussion started by: tpk
7 Replies

2. UNIX for Dummies Questions & Answers

Redirect Standard Error to /dev/null is not working.

Hello. When I run a .ksh that contains the command below, and there is no file available in the source location the "FILE_NAME_*.CSV not found" error is still being displayed. FILEN=$(ssh ${SOURCE_SERV} "cd ${SOURCE_LOCATION} ;ls ${FILES}") 2> /dev/null. This is interfering with the rest... (4 Replies)
Discussion started by: jimbojames
4 Replies

3. Shell Programming and Scripting

Redirecting standard out to /dev/null goes to file "/dev/null" instead

I apologize if this question has been answered else where or is too elementary. I ran across a KSH script (long unimportant story) that does this: if ; then CAS_SRC_LOG="/var/log/cas_src.log 2>&1" else CAS_SRC_LOG="/dev/null 2>&1" fithen does this: /usr/bin/echo "heartbeat:... (5 Replies)
Discussion started by: jbmorrisonjr
5 Replies

4. HP-UX

/dev/Null error

Hi Guru's, I am trying to test the network speed or load by this command. but getting error " Not Connected ". Could you guys please help. ftp> put "|dd if=/dev/zero bs=8k count=1000000" /dev/null Not connected. Please use code tags! (9 Replies)
Discussion started by: sris.sun
9 Replies

5. Shell Programming and Scripting

How to list Matching Directories OR NULL w/o error message?

I want to be able to get all the directories in a path into a variable array, BUT if there ARE NO directories I want the Variable to be NULL and not echo any error message! If there ARE directories, this will get the list of the directories whose name begins with the string "20":... (6 Replies)
Discussion started by: pgorbas
6 Replies

6. UNIX for Dummies Questions & Answers

/dev/null 2>&1 Versus /dev/null 2>1

How are these two different? They both prevent output and error from being displayed. I don't see the use of the "&" echo "hello" > /dev/null 2>&1 echo "hello" > /dev/null 2>1 (3 Replies)
Discussion started by: glev2005
3 Replies

7. Shell Programming and Scripting

Error output of cat to /dev/null

Hello, I'm trying to send the error output of a 'cat' operation to /dev/null like this: cat /dirA/dirB/temp*.log > /dirA/dirB/final.log 2>/dev/null This works perfectly in a terminal, but not when placed in a script. If there are no files matching temp*.log the script outputs an error... (7 Replies)
Discussion started by: Nils88
7 Replies

8. Solaris

What is /dev/tty /dev/null and /dev/console

Hi, Anyone can help My solaris 8 system has the following /dev/null , /dev/tty and /dev/console All permission are lrwxrwxrwx Can this be change to a non-world write ?? any impact ?? (12 Replies)
Discussion started by: civic2005
12 Replies

9. UNIX for Dummies Questions & Answers

Help to eliminate a warning message

Hi all, I'm trying to run this command in a script: utenti_conn=`ssh $MYUSER@$MYTRAP01IP sudo cat /opt/accenture/trapwriter/data/TMDVOD\-1\-\`date \+\%Y\%m\%d\`\* /opt/accenture/trapwriter/data/TMDBTV\-1\-\`date \+\%Y\%m\%d\`\*|awk -F'|' '{print $7}'|sort |uniq|wc -l` and in output I... (1 Reply)
Discussion started by: idro
1 Replies

10. Shell Programming and Scripting

error piping nohup to /dev/null

Hi, I have a script as follows: #!/bin/sh nohup ./my_program >& /dev/null & However, i get a "Generated or received a file descriptor number that is not valid" whenever I run it. running the command up in prompt is ok though. if i change the first line to #!/bin/csh i get a then:... (4 Replies)
Discussion started by: mochi
4 Replies

Featured Tech Videos