surpressing errors while running script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting surpressing errors while running script
# 1  
Old 03-03-2010
surpressing errors while running script

I have written shell script to find out pairsuspends in our environment.But when i run the script iam getting an error for the Pair which are not active.Below are the error am getting
Code:
pairvolchk -g up1012 -I11 
pairvolchk : execution error. 
pairvolchk: [EX_ENQCTG] Unmatched CTGID within the group 
Refer to the command log(/HORCM/log11/horcc_fauna.log) for details

How could i avoid those errors while running script.Below are the ouput while running the script

Code:
./checkpair.sh 11 
pairvolchk : execution error. 
pairvolchk: [EX_ENLDEV] No such LDEV within the RAID 
Refer to the command log(/HORCM/log11/horcc_fauna.log) for details. 
pairvolchk : execution error. 
pairvolchk: [EX_ENLDEV] No such LDEV within the RAID 
Refer to the command log(/HORCM/log11/horcc_fauna.log) for details. 
pairvolchk : execution error. 
pairvolchk: [EX_ENLDEV] No such LDEV within the RAID 
Refer to the command log(/HORCM/log11/horcc_fauna.log) for details. 

pairvolchk : execution error. 
pairvolchk: [EX_ENLDEV] No such LDEV within the RAID 
Refer to the command log(/HORCM/log11/horcc_fauna.log) for details. 
pairvolchk : execution error. 
pairvolchk: [EX_ENQCTG] Unmatched CTGID within the group 
Refer to the command log(/HORCM/log11/horcc_fauna.log) for details. 
pairvolchk : execution error. 
pairvolchk: [EX_ENQCTG] Unmatched CTGID within the group 
Refer to the command log(/HORCM/log11/horcc_fauna.log) for details.

Below are the lines causing problem

Code:
cat /etc/horcm$1.conf | grep -i flo |grep -v ^# |awk '{print $1}'> ${LogDir}/horcm$1.out 
for i in `cat $LogDir/horcm$1.out` 
do 
echo $i `pairvolchk -g $i -I$1` >> /tmp/offshore/out/$1.out 
done

Thankyou for reading this threadSmilie

Last edited by Scott; 03-03-2010 at 02:08 PM.. Reason: Please use code tags
# 2  
Old 03-03-2010
redirect stderr to /dev/null to get rid of error messages. you might be able to do that outside the script, i.e. ./scriptname 2> /dev/null. Or put 2> /dev/null right after the 'done'.
# 3  
Old 03-03-2010
Quote:
Originally Posted by Corona688
redirect stderr to /dev/null to get rid of error messages. you might be able to do that outside the script, i.e. ./scriptname 2> /dev/null. Or put 2> /dev/null right after the 'done'.

Is there anyother way i can rewrite those line
# 4  
Old 03-03-2010
I don't know enough about Sun/Hitachi device management to see why the totally uncommented script is producing those error messages in the first place, sorry. I see lots and lots of Useless Use of Cat in that script but that's neither here nor there.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Errors running perl statement

When I run this #!/bin/bash Block count: 421958912 Reserved block count: 4219589 perl -e "printf(\"%.1lf%%\n\", ($Reserved block count * 100.0 ) / $Block count);" I get these error messages. Can someone please help me? andyk_~/Downloads$ Show_Percent_Reserved_Blocks.sh... (4 Replies)
Discussion started by: drew77
4 Replies

2. UNIX for Dummies Questions & Answers

Invalid option errors running shell script

The script below fails with the following error messages: gzip: invalid option -- 'w' Try `gzip --help' for more information. mysqldump: Got errno 32 on write cp: invalid option -- 'w' Try `cp --help' for more information. rm: invalid option -- 'w' Try `rm --help' for more information. ... (1 Reply)
Discussion started by: ANNACTION
1 Replies

3. Shell Programming and Scripting

Command not found errors when running csh script

I am trying to find the number of files whose name starts with uni. Below is the code but it is giving error. :confused: #!/bin/csh FILES_NAME ='files_list'; FILE_NAME_PATTERN = 'uni*'; NO_OF_FILES; ls -l $FILE_NAME_PATTERN > $FILES_NAME ; NO_OF_FILES = `wc -l $FILES_NAME`; echo... (3 Replies)
Discussion started by: hiten.r.chauhan
3 Replies

4. Shell Programming and Scripting

Compilation errors in running configure script

Hi all, I tried to cross compile Ghostscript-8.54 source. I am getting some errors during cross compilation. I have pasted the errors below. CC=arm-unknown-linux-gnu-gcc LD=arm-unknown-linux-gnu-ld ./configure --host=i686-pc-linux-gnu --target=arm-unknown-linux-gnu --without-x && make ... (2 Replies)
Discussion started by: siva4ever
2 Replies

5. Shell Programming and Scripting

Script to capture errors

Hello; I'm trying to write a script to capture any hardware error from logs/syslog on my SUSE 10 servers so i can be notified if we have any hardware issues such a bad fan or battery, etc.. Thanks in advance for any help (2 Replies)
Discussion started by: Katkota
2 Replies

6. Solaris

Running from Shell Vs running from RC script

Hi, i have a script which need to do behave differently when run as a startup process from init.d/ rc2.d script and when run manually from shell. How do i distinguish whether my script is run by init process or by shell?? Will the command /proc/$$/psinfo | grep "myscript" work well???... (2 Replies)
Discussion started by: vickylife
2 Replies

7. Programming

Request help to debug errors while running in 'C'

I run, 2 'C' Files, gapw.c and getkey.c, but I get the following errors :- I) $ gcc gapw.c gapw.c: In function `main': gapw.c:96: warning: cast to pointer from integer of different size /tmp/cck4I8mW.o(.text+0x227): In function `main': : undefined reference to `getprofilestring'... (1 Reply)
Discussion started by: marconi
1 Replies

8. UNIX for Dummies Questions & Answers

unix script errors

#!/bin/ksh sqlplus -s user/passwd@remoteserver << EOF > errors2.log set pagesize 0 feedback off verify off heading off echo off select directory_nm || '/' || file_nm || '|' ||venue_id || '|' || time_id from file_control; EOF The output of this script is; ... (2 Replies)
Discussion started by: pavan_test
2 Replies

9. Shell Programming and Scripting

checking for script errors

ok, i have a script which i use to search my process' for specific keywords and kill any process containing them. there is a prompt to enter a keyword for searching and another prompt for which user you want to search the process' of. i want the script to have something that if you entered a search... (1 Reply)
Discussion started by: Blip
1 Replies

10. UNIX for Dummies Questions & Answers

errors when running a cron job

I am running some shell scripts through a foll cron job, the script works fine and there are no errors in the log file but I receive the following error in mail for the jobs: stty: no such device or address What does the above error indicate, here is the cron job: 0 22 * * 0... (2 Replies)
Discussion started by: knarayan
2 Replies
Login or Register to Ask a Question