Variable scope in subshell

Posted by 4Aiur on 03/10/2012 in Shell |

Variable scope in subshell functions [mlf4aiur@4aiur Shell]$ cat function_return.sh subshell () { # pipeline will generate subshell echo 1 2 3 | while read line do echo “subshell: inside 1”; var=1; return 1 done echo “subshell: inside 0”; var=0; return 0 } subshell echo “subshell: outside return $? var=$var” foo () { for line in […]

Tags:

Copyright © 2010-2024 4Aiur All rights reserved.
This site is using the Desk Mess Mirrored theme, v2.5, from BuyNowShop.com.