Hi all,
My kshell code is not working, when I use a function to return something. But when I use the same function as without returning any values, it is working. Pls help me here.
Code1 :
func1 () {
y=`echo $x | grep XXX| cut -f 2 -d ' '`
if [ -z "$y" ]; then
exit 100
else
echo $y
fi
}
x="HAPPY WORLD"
z=`func1`
echo $x
echo $z
Output:
HAPPY WORLD
Code2:
x="HAPPY WORLD"
func1 #same function as above#
echo $x
No output.... exit command into the function worked here.
How can I change my fucntion in code1 to exit from the script?
Regards,
Poova.