SyntaxFix
Write A Post
Hire A Developer
Questions
Quotes!
if [ "$1" != -v ]; then
Otherwise, when $1 is completely empty, your test becomes:
$1
[ != -v ]
instead of
[ "" != -v ]
...and != is not a unary operator (that is, one capable of taking only a single argument).
!=