Homework 3

This homework is worth 15 points.

Goals

When you finish this homework you should:

Assignment

Please use man pages to answer the following questions. Please reference the operating system (machine or distro will do).
  1. [1 point] What is a login shell?
  2. [3 points] What happens when bash starts? From which files are commands executed?
  3. [3 points] Look at the files listed above and describe the tasks performed in these files.
  4. [3 points] ssh
    1. What occurs when a user executes ssh without a command?
    2. How could you use ssh to determine if I am logged into cslab100? Give a command you might type. (The -t option will eliminate an error message)
    3. What environment variables will ssh set on the remote host?
  5. [5 points] Read the man page for getenv. Write a program which checks for the following environment variables and prints a greeting. So if the following were set:
    TITLE="Her Majesty"
    FIRST_NAME="Elizabeth"
    LAST_NAME="the Second"
    HONORIFIC="by the Grace of God of the United Kingdom of Great Britain and Northern Ireland, and of Her other Realms and Territories Queen, Head of the Commonwealth, Defender of the Faith"
        
    Then your program would print
    $ greeting
    Greetings to Her Majesty Elizabeth the Second by the Grace of God of the United Kingdom of Great Britain and Northern Ireland, and of Her other Realms and Territories Queen, Head of the Commonwealth, Defender of the Faith. 
        
Submit a hard copy of the questions on paper at the beginning of class on the due date. Email a copy of the C code to complete the final task to your instructor by class time.