COP 2344 (Shell Scripting) Project #1
Basic Commands and Wildcards


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


Answer the following questions as briefly (but completely) as possible.  (These are thought exercises.  You are not supposed to type them in, but you can later, to check your answer after you have thought about it.)


  1. Given the following files in your current directory:
        feb96 jan12.02 jan19.02 jan26.02 jan5.02 jan95 jan96 jan97 jan98 mar98 memo1 memo10 memo2

    What would be the output of the following commands?  (Note, ranges in globs are guaranteed to work properly only in the POSIX locale, so assume that.)

    1. echo *
    2. echo *[!0-9]
    3. echo m[a-df-z]*
    4. echo [A-Z]*
    5. echo jan*
    6. echo *.*
    7. echo ?????
    8. echo *02
    9. echo jan?? feb?? mar??
    10. echo [fjm][ae][bnr]*
  2. What is the effect of the following:
    1. ls | wc -l
    2. rm ???
    3. who | wc -l
    4. mv progs/* /users/steve/backup
    5. ls *.c | wc -l
    6. rm *.o
    7. who | sort
    8. cd; pwd
    9. cp memo1 ..
    10. plotdata 2>errors &

To be turned in:

The answers to the above questions.  Where appropriate, feel free to use the script command to record your sessions.  See the man page for script for more details.  Then you can email to me the resulting typescript file created.

You can type or send as email to .  Please use the subject similar to “Shell Scripting Project 1 Submission”, so I can tell which emails are submitted projects.

Send questions about the assignment to .  Please use a subject similar to “Shell Scripting Project 1 Question” so I can tell which emails are questions about the assignment (and not submissions).

Please see your syllabus for more information about submitting projects.