Quote:
Originally Posted by vinaytp
Hi all..
I have following script.
Code:
#!/bin/bash
export VAR="shell"
echo " $VAR in parent "
bash
echo "shell in child "
If i execute this script, the output is just
Why can't I see the output shell in child ?
Can any one clear this doubt..
|
bash. Here you are calling the bash command means that you are calling another bash shell.
To be more understandable you are calling a BASH inside a BASH.
enter
exit to come out of that BASH environment to your previous BASH environment as fallows:
Code:
[Ashok@station130 ~]$ sh temp.sh
shell in parent
[Ashok@station130 ~]$ exit
exit
shell in child
Now you are able to see the output
shell in child 