I am having two different function in my script. When control is at first function I do not want to execute another function. How I can do that?
Help is highly appreiated as I am not sure How I can do it in Unix?
Thanks,
Vikram.
I am having two different function in my script. When control is at first function I do not want to execute another function. How I can do that?
Help is highly appreiated as I am not sure How I can do it in Unix?
Thanks,
Vikram.
I'm not sure if I understood your question correctly. See if this helps:
function func1 {
# statements
# statements
echo "func1"
f1_flag=1
}
function func2 {
if [ $f1_flag == 1 ]
then
echo "func1 has already run. So, exiting from func2"
return 1
fi
echo "func2"
# statements
# statements
}
func1
func2
Unless you call funcx from within funcy, there's no chance they execute simultaneously in a single process. Or are you talking of multiple processes?