Hi,
I have a following script:
--------------------------------------------------
#!/bin/ksh
function start{
var=abc
echo "in function var=$var"
}
start | tee log
echo "in program var=$var"
--------------------------------------------------
This is the output I get:
in function var=abc
in program var=
(i.e. get empty value for var)
When I remove "| tee log"
I get the proper output:
in function var=abc
in program var=abc
How can you explain and fix it?
Thanks in advance,
Vadim
I have a following script:
--------------------------------------------------
#!/bin/ksh
function start{
var=abc
echo "in function var=$var"
}
start | tee log
echo "in program var=$var"
--------------------------------------------------
This is the output I get:
in function var=abc
in program var=
(i.e. get empty value for var)
When I remove "| tee log"
I get the proper output:
in function var=abc
in program var=abc
How can you explain and fix it?
Thanks in advance,
Vadim