pdksh and mksh inappropriately do tilde expansion on arbitrary arguments that happen to end with the two unquoted characters "=~". This should only happen for real shell assignments (i.e. not even with assignment-like arguments to "export" and the like).
Command: echo "some arbitrary stuff "=~ Actual output is like: some arbitrary stuff =/Users/martijn Expected output: some arbitrary stuff =~ - M.