I understand how a substring extraction is done,
Code:
${string:position:length}
but I don't understand how I can actually use * or @ in this context. The explanation from Advanced Bash Scripting isn't enough:
If the $string parameter is "*" or "@", then this extracts a maximum of $length positional parameters, starting at $position.
Code:
echo ${*:2} # Echoes second and following positional parameters.
echo ${@:2} # Same as above.
echo ${*:2:3} # Echoes three positional parameters, starting at second.
So it extracts the maximum of $length position parameteres, but what from, if the string is * or @?
Can you offer any concrete examples?