CSCI 3308 - Lab 0

Here are the answers to Lab 0.

  1. What command would find the man page for exit in section 2 of the manual?

    man 2 exit

  2. What command would list all the man pages related to the keyword network?

    apropos network OR man -k network

  3. Why do some commands appear in multiple sections of the manual. For instance, try executing the commands man 2 open and man 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>

  4. 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.

  5. Explain what is being demonstrated by the commands above.

    exporting variables makes them visible in child instances

  6. 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

  7. What are the values of b and PHRASE after executing the above statements?

    b="deep blue" PHRASE="the : deep blue : sea"

  8. What happened and why?

    b is shell variable, PHRASE environment variable. Latter is therefore visible in child process.

  9. Why not?

    PATH is just set in that instance

  10. 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

  11. 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