36.10. How to Unset All Command-Line Parameters
The shift (Section 35.22) command "shifts away" one command-line parameter. You can shift three times if there are three command-line parameters. Many shells also can take an argument, like shift 3, that tells how many times to shift; on those shells, you can shift $# (Section 35.20) to unset all parameters.
The portable way to unset all command-line parameters is probably to set (Section 35.25) a single dummy parameter, then shift it away:
+set x shift
Setting the single parameter wipes out whatever other parameters were set before.
Copyright © 2003 O'Reilly & Associates. All rights reserved.