Write and run a simple shell script named echomyvar that displays the PID (Sobell, page 480) of the process running the script and value of the variable named myvar. Display the PID of the interactive shell you are working with. What is the value of the variable within the process running the shell script? Are the interactive shell and the shell running the script run by the same or different processes (do they have the same PID)?
$ cat echomyvar
echo The PID of this process is $$
echo The value of myvar is: $myvar
$ echo $$
2651
$ ./echomyvar
The PID of this process is 4392
The value of myvar is:
The value of the myvar variable within the process running the shell script
is null. The interactive shell and the script are run by different processes
(that have different PIDs).
You might also like to view...
The following loop would execute how many times? Loop index from 0 up to (but not including) 4 times incrementing by 2
a. 1 b. 2 c. 3 d. 4 e. None of these
How many usable host IP addresses are available given the following IP address and subnet mask? ip address 10.10.20.1 255.255.255.224
What will be an ideal response?
You can create a custom color by selecting amounts of red, green, and yellow
Indicate whether the statement is true or false
If your Web site is already up and running, you can look at your ____ logs to find out which browsers your visitors are using.
A. mainframe B. network C. browser D. server