command can get even cleaner:
sed -r 's/(abcd"abcd)/\1/g'
sed -r 's,(abcd"abcd),\1,g'
As for the single quotes, they are telling the shell not to interpret anything found between them, & to pass the enclosed argument(s) to grep
, or whatever.
If you want to pass the value (as opposed to its literal name) of a shell to a program, then use the double quotes.
It is a good habit, rarely a mistake, to enclose the regex passed to grep