Bash Positional Parameters
Positional parameters hold the arguments given to a script or function: $1 is the first, $2 the second, and so on.
Use braces from the tenth one on: ${10}. shift drops $1 and moves the others one place down.
Read the arguments
Save this as args.sh:
#!/bin/bash
echo "First: $1"
echo "Second: $2"
Run it:
./args.sh apple banana
First: apple
Second: banana
Move the arguments with shift
Save this as shift.sh:
#!/bin/bash
echo "Before: $1"
shift
echo "After: $1"
Run it:
./shift.sh apple banana
Before: apple
After: banana