#!/bin/sh -u # This shell script displays the command line arguments. # ------------------------------------------------------------------ # Syntax: # $0 [args...] # ------------------------------------------------------------------ # Purpose: Count and display each argument to this shell script. # It also displays the command name, which is often referred to as # "Argument Zero" ($0) but is never counted as a command argument. # ------------------------------------------------------------------ # Student Name: Ian! D. Allen # Algonquin Email Address: alleni # Student Number: 000-000-000 # Course Number: XXX 0000 # Lab Section Number: 099 # Professor Name: Dennis Ritchie & Brian Kernighan # Assignment Name/Number/Date: Exercise 123, due Sept 1, 2010 # Comment: This is a sample assignment label. # ------------------------------------------------------------------ # Set the search path for the shell to be the standard places. # Set the umask to be non-restrictive and friendly to others. # PATH=/bin:/usr/bin ; export PATH umask 022 # The $0 variable contains the name of this script, sometimes called # "argument zero". It is not an argument to the script itself. # The script name is not counted as an "argument" to the script; # only arguments 1 and up are counted as arguments to the script. # echo "Argument 0 is [$0]" # Now display all of the command line arguments (if any). # These are the real command line arguments to this script. # let count=0 for arg do let count=count+1 echo "Argument $count is [$arg]" done exit 0 # zero is a good return status