The following script can only print -m but it can't print -n.
#!/bin/sh
echo $@
$ sh test.sh -m
-m
$ sh test.sh -n
$
The following script can only print -m but it can't print -n.
#!/bin/sh
echo $@
$ sh test.sh -m
-m
$ sh test.sh -n
$
That's because -n is an actual option to echo. Most tools support -- to mean "there's no more options after this, just arguments", so try if using
echo -- $@
improves the situation.