Team,

Could you let me know what the below function does which is part of my actual script..
Yeah as per my understanding it checks whether the TAR file has been completed or not.. but what is the 1; does below is it end of line or something other..


CheckRetStat "Move of ${FileType} TAR File Completed" "Unable to Move ${TARFile} to ${TargetDIR}" 1;

Many Thanks
Whizkid

I am looking for shell script to give some limited previlege to end user being an administrator

Whizkid: I think we might need more context... If I had to guess, "CheckRetStat" is probably a function, defined elsewhere in the script.

verdascofernan: I'm not sure what you mean, but it doesn't appear to be related to this thread, so you might have better luck starting a new thread :)

READ YOUR CODE !

CheckRetStat() {
RetStat=$?;
SuccessMsg=$1;
ErrorMsg=$2;
ExitIfErr=$3;

if [ $RetStat -ne 0 ]; then
LogThis "***** ERROR - $ErrorMsg";
# Exit Script if the ExitIfErr value is 1";
if [ $ExitIfErr -eq 1 ]; then
WriteAlert 14112;
exit $RetStat;
fi
else
LogThis "SUCCESS - $SuccessMsg";
fi

}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.