Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • 12
    shift $(($# - 1)) - no need for an external utility. Works in Bash, ksh, zsh and dash. Commented Nov 9, 2010 at 2:32
  • @Dennis: Nice! I didn't know about the $((...)) syntax. Commented Nov 11, 2010 at 16:48
  • 1
    You'd want to use printf '%s\n' "$1" in order to avoid unexpected behaviour from echo (e.g. for -n).
    – joki
    Commented Jan 4, 2018 at 9:39