Você está na página 1de 1

comp.unix.shell: Exit Status Not Returned?

Exit Status Not Returned?


Source: http://unix.derkeiler.com/Newsgroups/comp.unix.shell/200504/1195.html

From: absinth (absinth_at_gmail.com)


Date: 04/29/05
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

Exit Status Not Returned?

Você também pode gostar