All Forums Analytics
terankit 77 posts Joined 03/12
15 Mar 2012
How to use Fastexport exit codes in UNIX Shell Script

Hi,

In my shell script I am using BTEQ, which is doing Fastexport. I will get two return codes. One from BTEQ and another from Fast Export. I want to use the Fast Export Return code in my Unix script to do the further processing.

I found that return codes automatically stores in $? and we can use that. but it is not working.

If RC !=0 then

do not merge the files

else

merge the files

fi

 

Thanks,

Terankit

terankit 77 posts Joined 03/12
18 Mar 2012

Anyone??? Is this the right place to ask this question or should I ask this in any UNIX forum?

 

Thanks,

Terankit

ulrich 816 posts Joined 09/09
19 Mar 2012

Hi, I think you will find in unix / linux forums more valuable answers.

But you need to do something like

 

#!/usr/bin/ksh

LOG=./thisDBSetupRun.log

bteq < your_code.btq >>$LOG 2>&1
RC=$?

echo "STATUS: $RC" >>$LOG

if [ $RC != 0 ]; then
   echo "End with ERROR. ($RC)" >>$LOG
   exit;
fi

feel free to donate bitcoin:12kgAUHFUqvG2sQgaRBXFhCwyf9HXdkGud

You must sign in to leave a comment.