You would get the "too many arguments" if the variables contain whitespace, which would cause the unquoted expansions to split to multiple words. So, indeed, you must quote all variables within [ .. ]
to prevent that.
The second if
you wrote (if [ "$inputstring" = "$INPUT" ]
) is correct, and would run the main branch of the if
, if the two variables indeed contain the same data. But depending on where they come from, you might have extra whitespace within them, or something else that is hard to see. Use e.g. printf "<%q>\n" "$INPUT"
to see the variable contents in an unambiguous format. (The output format depends on the value of the variable, but generally it prints it quoted and/or shows special characters with backslash-escapes.)
For example, the variables don't contain the same data here, the latter has a trailing space:
$ foo=123
$ bar="123 "
$ echo $foo $bar
123 123
$ if [ "$foo" = "$bar" ]; then echo same; else echo not same; fi
not same
$ printf "<%q>\n" "$foo" "$bar"
<123>
<123\ >