CSCI 3308 - Lab 0
Here are the answers to Lab 0.
What command would find the
man
page forexit
in section 2 of the manual?man 2 exit
What command would list all the
man
pages related to the keywordnetwork
?apropos network OR man -k network
Why do some commands appear in multiple sections of the manual. For instance, try executing the commands
man 2 open
andman 3 open
.different sections for different user groups, i.e. user vs. programmer, or, different sections for different types of commands, such as a shell command vs. a library function. A more complete answer can be found at: <http://kb.iu.edu/data/abzo.html>
What shell are you using?
Looking for </bin/bash> and/or </bin/tcsh>. All students should switch to using
bash
for their shell for the remainder of the semester.Explain what is being demonstrated by the commands above.
exporting variables makes them visible in child instances
List all of the variables given above, and say whether each is a shell variable or an environment variable.
shell: a, b; environment: C, PHRASE
What are the values of
b
andPHRASE
after executing the above statements?b="deep blue" PHRASE="the : deep blue : sea"
What happened and why?
b is shell variable, PHRASE environment variable. Latter is therefore visible in child process.
Why not?
PATH is just set in that instance
Why is it important to add this particular directory after the
.bashrc
file has been executed?It is the .bashrc file that sets the values of ARCH and C3308. These values need to be defined before a PATH statement like the following will work correctly: PATH=$PATH:$C3308/arch/$ARCH/bin
This shell script is an architecture-independent executable file (because the
bash
interpreter has been ported to many different architectures). In what directory should it be placed?$HOME/csci3308/bin