CTS 1106 (Intro to Unix/Linux) Homework Assignment #5

 

Due: by the start of class on the date shown on the syllabus

Description:

Answer the following questions as briefly (but completely) as possible.  Unless otherwise stated, assume a POSIX shell (such as bash) is used.

  1. Using shell wild cards, write a pattern to match any filenames where the first character is alphabetic and the last is not numeric.
  2. How would you remove a file beginning with a hyphen in the $HOME/foo directory?
  3. What actually happens when you use the command “cat foo > foo”?  What about “sort -o foo < foo”?  (Don't simply show the output of running those commands.)
  4. What is a filter command?  From where does a filter command get its input?
  5. What are the effects of using double quotes on command line arguments?
  6. What are the names of two environment variables set by reading /etc/passwd when you login?  (Actually there are at least four; limit yourself to the ones listed in the syllabus.)
  7. How would you add the current directory (no matter what it is) to your existing PATH?  Why would that be a bad idea?
  8. If you run “PS1='\!$ '” (without the curly quotes), what sort of prompt will you get using the Bash shell?  (In POSIX compliant mode of shell, use “PS1='!$ '” instead.)  What does the prompt message mean?
  9. Write a Korn or Bash shell alias to list only the hidden files of the current directory.  (Extra credit if your alias doesn't list . or .. entries.)
  10. You have just used the command “tar -cvf /dev/fd0 *.sh”.  How can you repeat the command to use *.pl files instead of *.sh files, with the Bash shell, without retyping the entire command?

To be turned in:

Email your homework assignment, by copy-and-paste (no attachments please!) to .  If possible use the “text” and not the “HTML” mode of your email program.  Please use the subject similar to “Intro to Unix/Linux Homework Assignment #5 Submission”, so I can tell which emails are submitted homework assignments.

Homework assignments will not be returned.  Please do not send as attachments.  Do not send to wpollock@YborStudent.hccfl.edu.  Refer to the Homework and the Submitting Assignments sections of your syllabus for more information.

Confused?  Send questions about the homework assignment to .  Please use a subject similar to “Intro to Unix/Linux Homework Assignment #5 Questions” so I can tell which emails are questions about assignment quiz (and not submissions).