The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
check exit status - Expect Script iamcool Shell Programming and Scripting 1 01-02-2008 06:07 AM
Script to check status of a PID zeekblack Shell Programming and Scripting 14 10-03-2006 12:09 PM
checking exit status of a shell script kdipankar Shell Programming and Scripting 2 05-08-2006 10:08 PM
check the status and send an email with status isingh786 Shell Programming and Scripting 3 12-29-2005 04:22 PM
CronTab script exit status 134 VijayKumar Shell Programming and Scripting 3 03-24-2005 08:56 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 06-24-2006
Registered User
 

Join Date: May 2006
Posts: 18
Post how to check exit status in awk script

Hi,

I have a main program which have below lines

-
awk -f test.awk inputFileName
-
I wonder how to check status return from awk script.



content of awk script:
test.awk
---
if ( pass validation )
{
exit 1
}
else
{
exit 0
}
Reply With Quote
Forum Sponsor
  #2  
Old 06-24-2006
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 4,298
the awk man page says that for exit <value> - value is returned to the shell and must be a value from 0 - 255

Code:
awk -f test.awk inputFileName
if [ $? -eq 0 ] ; then
    echo "Pass"
else
    echo "Fail"
fi
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 02:50 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