An extra shift in the if statement causes it to move forward 2 arguments instead of 1 on the next loop, skipping the next argument.
Example: ./install.sh -c -d '[filepath]' would shift twice after the -c which skips the -d and tries to read the filepath as the next argument, causing an unknown argument error.
An extra
shift
in the if statement causes it to move forward 2 arguments instead of 1 on the next loop, skipping the next argument.Example:
./install.sh -c -d '[filepath]'
would shift twice after the-c
which skips the-d
and tries to read the filepath as the next argument, causing an unknown argument error.