Download Unix Shell Programming is a tutorial aimed at helping Unix and
Transcript
While the number of arguments is not equal to zero, the value of $1 is displayed and then a shift executed. Recall that this shifts down the variables (that is, $2 to $1, $3 to $2, and so on) and also decrements $#. When the last argument has been displayed and shifted out, $# will equal zero, at which point execution of the while will be terminated. Note that if no arguments are given to prargs (as was done in the last case), the echo and shift are never executed because $# is equal to zero as soon as the loop is entered.