I have SED patterns:
[^a-zA-Z0-9]
/b\./s/.*c\.. \([^ ]*\) .*/\1/p
and so on.
I need to pass these to an echo command as variables.
At the moment, I define the $pattern variable like so:
$pattern="[^a-zA-Z0-9]"
and then pipe it to echo, like so:
echo "$OUTPUT" | sed "s/$pattern/g"
But the code is not passing the pattern, but a command and returns the error
=[^a-zA-Z0-9]: command not found
What's going wrong?