Reporting the arguments, then consuming one
Reporting the arguments, then consuming one
Answer
echo "name: $0" echo "count: $#" echo "all: $@" shift echo "count: $#" echo "first: $1"
Called with five arguments this prints 5, then 4 after the shift, and the first argument reported at the end is the one that used to be second. The one that used to be first cannot be recovered.
S&K 3e ch12 §12.4