Assignment: #FinalAssessment Due: 12/12/02018 Points: 10
  1. Match the programmer to their respective creation.

       Stroustrup      Shell
       Ritchie         Unix
       Thompson        C++
       Bourne          C
    


  2. C is a structured programming language. C++ is considered a "better" C that also supports what type of programming?


  3. Without using a computer, record what the following C++ code snippet prints.

       char x[] = { 'd', 'w', 'o', ' ', 'g', 'b', 'l', 'e', 'r', 'y', ',' };
       int y[] = { 4, 2, 2, 0, 5, 9, 7, 10, 3, 1, 2, 8, 6, 0, -1 };
       for (int z = 0; y[z] != -1; z++) 
          cout << x[y[z]];
       cout << endl;
    

  4. The following is a C++ function prototype:

       void foo(int, int*, int&);
    

    Briefly explain what the function prototype is declaring.


  5. Numerous file oriented shell commands will get input from the _________________ when no file name(s) are used on the command-line.


  6. Briefly explain what the following two command-lines do.

       $ touch -t 201810310314.16 foo
       $ find ~ -type f -cnewer foo
    

  7. Record what the following command-line prints.

       $ echo "WHO_AM_I=foo" | cut -f2 -d=
    

  8. Record the command-line that would change the permissions for a file named goo to -rw-r--r--.


  9. If the following command-line works:

       $ cp a b c 
    

    then we know files a and b are existing files and that c is an existing what?


  10. You have a process having a pid (process id) of 1618 that needs to be killed. The following command does not kill the process.

       $ kill 1618
    

    [a] What signal was sent to the process?

    [b] Record the command-line that will kill the process.


  11. Assume there is a program named foo. Briefly explain the following command-line.

       $ foo >x 2>y
    

  12. Briefly explain the following command-line.

       $ grep iostream *.cpp   | grep "stdio"
    

  13. Briefly explain the following command-lines.

       $ cat a >x
       $ cat b >>x
    

  14. Rewrite the following two command-lines using only one command-line that uses only one cat command.

       $ cat a >x
       $ cat b >>x
    

  15. Record the last line of output for the following sequence of command-lines.

       $ head -1 /etc/passwd
       root:x:0:0:root:/root:/bin/bash
       $ grep -iq root /etc/passwd
       $ echo $?
    

  16. Briefly explain the following shell session elaboring on how the shell uses the PATH environment variable.

       $ echo $LOGNAME
       gdt
       $ echo $HOME
       /home/gdt
       $ echo $PATH
       /bin:/usr/bin:/usr/local/bin:/home/gdt/bin:.
    

  17. Briefly explain the following command-line.

       $ ls [A-Z]b?9*x
    

  18. Fill in the blanks with the following: 0, 1, 2, cout, cerr, cin, stdout, stderr, stdin.

       shell      C         C++
       ==========================
       _____      _____     _____
       _____      _____     _____
       _____      _____     _____
    

    Note: 0, 1, 2 are file descriptors; cout, cerr, cin are object variables; stdin, stdout, stderr are FILE* variables.


  19. Rewrite the following command-line so that it uses only one pipe.

       cat a5 | grep "^ans" | wc -l
    

  20. Briefly explain the Unix philosophy.


  21. Go back in time to June of 02011 (7+ years ago) and watch...

    ...then finish this quote: "And where does Ritchie think we're headed _____________________."