That
sed command can get even cleaner:
Code:
sed -r 's/(abcd"abcd)/\1/g'
and prettier:
Code:
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,
sed, 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 in
single quotes.