Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Return a val from a function

Status
Not open for further replies.

alhassani54

Programmer
Aug 1, 2002
27
0
0
GB
my script
#!/bin/ksh
#
function f_a
{
flag=1
}

function f_b
{
integer flag=0
f_a
if [[ $flag = 1 ]]; then
echo "flag=1"
fi
}
.
.
.
from function f_a I would like to return the value of flag equal 1 to function f_b.

Any help will be appreciated.

Thanks

Kais
 
I exported flag inside the function f_b and outside but it did not work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top