To check the above problem, you can do the following
Create a script like -
read a echo "You entered : $a"
Save it (say script.sh) and change the resolution if necessary.
In the same tab, run the ps command and pay attention to the shell pid (say p1).
Now run the script (i.e...sh)
Script will ask for input but will not provide input. Now in another tab somthing is launched as' ps -ef | grep pts'. Here you will find that there are two shell processes. You have another shell whose ppid is equal to the pid of the previous shell, i.e. p1.
Thus, basically every shell script call creates a new process and therefore a new context.
Hope this helps.
source share