The shift command

Shift positional parameters. 2 examples from the lessons of the IVski Linux Playground — try them in the terminal next to them.

Examples

shift

Remove first argument, rest shifts left

if [ "$1" = "-n" ]; then DRY=1; shift; fi

shift: drop $1, the folder becomes $1

Lessons that use shift