/bin/sh => STDIN & functions, var scope messing

rank1seeker at gmail.com rank1seeker at gmail.com
Mon May 27 19:42:39 UTC 2013


9.1-RELEASE-p3
---------------
#!/bin/sh

sh_f ()
{
    global_scope_var=7463457
}

yes | sh_f
echo "$global_scope_var"

echo '
Now without /usr/bin/yes (maybe it is STDIN issue, instead) ?!?
'

sh_f
echo "$global_scope_var"
---------------


Domagoj Smolčić


More information about the freebsd-hackers mailing list