Each short option character in shortopts may be followed by one colon to indicate it has a
required argument, and by two colons to indicate it has an optional argument.
-h option did not actually require argument but was followed by a colon, causing the error.
Thus, removed extraneous colon.
Result: calling install.sh -h now works, shows the script usage and stops the script as intended.
Calling
install.sh -h
failed to show the script usage. The -h option of install.sh did not work and script just went on with default settings.From getopt man page:
-h
option did not actually require argument but was followed by a colon, causing the error. Thus, removed extraneous colon.Result: calling
install.sh -h
now works, shows the script usage and stops the script as intended.