Reputation: 98
I have a tmp.cmd
file I am stripping of specific quotation marks.
It looks like this:
"grep -rFIil ""ACTVY_LOG""| xargs grep -iF ""ACTVY_ENT"""
"grep -rFIil ""ACTVY_LOG""| xargs grep -iF ""ACTVY_PTR"""
I want it to look like this:
grep -rFIil "ACTVY_LOG"| xargs grep -iF "ACTVY_ENT"
grep -rFIil "ACTVY_LOG"| xargs grep -iF "ACTVY_PTR"
I have been able to strip the first and last quotation using this command:
sed -r 's/^"|"$//g' tmp.cmd > tmp1.cmd
.
So that it looks like this grep -rFIil ""APE.ACTVY_LOG""| xargs grep -iF ""ACTVY_ENT_TSTMP""
.
How can I remove the other quotations? Thanks for any help.
Upvotes: 1
Views: 33
Reputation: 295687
If you want to change ""
to "
, that's s/""/"/g
.
Thus:
sed -e 's/^"//' -e 's/"$//' -e 's/""/"/g'
See this running against your stated input in an online sandbox at https://ideone.com/WOuXjU
Upvotes: 2