The line checks whether the second positional parameter is greater than
0. If the condition is true then it shifts the positional parameters 3, 4, ... to 1, 2, ... If the condition is false then it shifts the positional parameters 2, 3, ... to 1, 2, ...
Constants with leading zero are interpreted as octal numbers. Saying
10#$2 causes the positional parameter
$2 to be interpreted as a decimal. You might also want to refer to Shell Arithmetic.
((10#$2 > 0)) checks if the second positional parameter represented in base 10 is greater than 0.
2>/dev/null causes any errors resulting from this test to be redirected to
/dev/null. See Bash Arithmetic Expressions for more on the
|| are conditional constructs. So if the condition is true then
shift 2 is executed else
shift is executed.
expression1 && expression2
True if both expression1 and expression2 are true.
expression1 || expression2
True if either expression1 or expression2 is true.
As an example, refer to the following:
$ ((10>42)) && echo greater || echo smaller # Condition is false so the `echo smaller` expression is evaluated
$ ((100>42)) && echo greater || echo smaller # Condition is true so the `echo greater` expression is evaluated
Quoting from the manual:
(( expression ))
The arithmetic expression is evaluated according to the rules described below (see Shell Arithmetic). If the value of the expression
is non-zero, the return status is 0; otherwise the return status is 1.
This is exactly equivalent to