-
-
Save ceclinux/6505054 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
A=B | |
export A | |
echo "PID for 1.sh before exec/source/fork:$$" | |
echo "1.sh: \$A is $A" | |
case $1 in | |
exec) | |
echo "using exec..." | |
exec ./2.sh ;; | |
source) | |
echo "using source..." | |
. ./2.sh ;; | |
*) | |
echo "using fork by default..." | |
./2.sh ;; | |
esac | |
echo "PID for 1.sh after exec/source/fork:$$" | |
echo "1.sh: \$A is $A" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment