shell: Check number of arguments before shifting