This is probably something kick-self obvious but I have to ask as I'm not seeing it.
I'm trying to make the following substitution in this text file. I want this:
bind_password = 'grafana'
to become this:
bind_password = ''
I've tried using the following regex one-liner on the file that contains the line:
$ perl -0pe 's/(bind_password = \')grafana\'/$1\'/g' file.txt
bash: syntax error near unexpected token `)'
When I've tried the regex on regex101, it's worked fine: https://regex101.com/r/0fb4Pu/1. The difference is that I've had to escape the single quotes. I've tried using double quotes instead of single around the regex, as in:
perl -0pe "s/(bind_password = ')grafana'/$1'/g" file.txt
But while this doesn't return an error, it doesn't do what I want. It instead replaces the string with a single colon, like so:
'
What am I doing wrong here?