Exit Status Not Returned?
From: absinth (absinth_at_gmail.com)
Date: 04/29/05
- Next message: absinth: "Re: Exit Status Not Returned?"
- Previous message: Chris F.A. Johnson: "Re: ksh - trying to cat a file and grep 2 parameters"
- Next in thread: absinth: "Re: Exit Status Not Returned?"
- Reply: absinth: "Re: Exit Status Not Returned?"
- Reply: Chris F.A. Johnson: "Re: Exit Status Not Returned?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 28 Apr 2005 22:55:57 -0700
Can someone help me with this in KSH and tell me why the exit status is
not returned?
Why is "haha" printed?
#!/bin/ksh
getNoGlobalProc()
{
local a=`ls sdfafa`
if [[ $? -ne 0 ]]; then
echo "$SCRIPTNAME : $LINENO : Could not obtain global number of
processes running"
return 1
fi
echo "haha"
return 0
}
getNoGlobalProc
- Next message: absinth: "Re: Exit Status Not Returned?"
- Previous message: Chris F.A. Johnson: "Re: ksh - trying to cat a file and grep 2 parameters"
- Next in thread: absinth: "Re: Exit Status Not Returned?"
- Reply: absinth: "Re: Exit Status Not Returned?"
- Reply: Chris F.A. Johnson: "Re: Exit Status Not Returned?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]