nocache does not properly handle the situation where an invalid flag was passed to the script. It complains about the options and continues. The correct thing to do would be to print a usage statement and exit. It would also be nice to add a help option to print the usage info. $ nocache --help echo foo /usr/bin/nocache: illegal option -- - /usr/bin/nocache: illegal option -- h /usr/bin/nocache: illegal option -- e /usr/bin/nocache: illegal option -- l /usr/bin/nocache: illegal option -- p foo $ shellcheck -eSC2145 `which nocache` In /usr/bin/nocache line 6: case "$opt" in ^-- SC2220: Invalid flags are not handled. Add a *) case. $ cp `which nocache` . $ sed -i 's/esac/*) echo usage statement here ; exit ;; esac/' nocache $ ./nocache --help echo foo ./nocache: illegal option -- - usage statement here