Fix add_to_list() for bash and dash

by using the correct POSIX negation character in the pattern match ('!'
in stead of '^').