Skip to content
Advertisement

Tag: quotes

grep command in linux using ” in regex

I have the following linux cmd: The text i have is the following: Of course the output i want to have is: Why dont i have the correct output? Because of the ” required by the grep which mix with ” in my text? How to fix it? Answer You could use the following regex: Original poster provided a regex

Stripping single and double quotes in a string using bash / standard Linux commands only

I’m looking for something that will translate a string as follows, using only bash / standard Linux commands: Single-quotes surrounding a string should be removed Double-quotes surrounding a string should be removed Unquoted strings should remain the same Strings with unmatched surrounding quotes should remain the same Single-quotes that don’t surround the string should remain Double-quotes that don’t surround the

Advertisement