![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| some information on error checking | vinayrao | Shell Programming and Scripting | 1 | 03-14-2008 12:07 PM |
| Need help with error checking | xianoth | Shell Programming and Scripting | 0 | 08-31-2007 12:47 PM |
| Error code checking | jepombar | Shell Programming and Scripting | 3 | 08-21-2007 02:50 PM |
| Disk health & error checking | hcclnoodles | SUN Solaris | 2 | 10-18-2006 10:33 AM |
| Error Checking Problem | pokeycam | Shell Programming and Scripting | 4 | 09-13-2006 04:38 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
error checking in bash
Could someone please advise on a good way to implement error checking in a script?
i am taking input from a file, iserting it's values into two commands and sending the output of each to seperate log files. i need to check those log files for for an occurance of 'error', stop the command if 'error' exists,. if it does not, then continue to next command. i have this so far....using mkdir for testing purposes. ...exerpt for COMPONENT in `cat $1|awk '{print $1, $2}'` do printf "\n \n Creating components for $COMPONENT \n" mkdir $COMPONENT >> ~/scripts/$COMPONENTERROR 2>&1 if grep error $COMPONENTERROR ! 1 || { echo "check error log"; exit 1; } fi printf "Creating Island $2 \n" mkdir $2 >> ~/scripts/$ISLANDERROR 2>&1 #if [stop_this -eq 1] then exit "STOP" else #fi done .... or should i take another approach? |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|