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
Tag: quotes
How to use content of variable in bash to pass to find in script?
In a bash script I’m trying to use the content of a variable to be used as options for the find command: The aim is to set proper access rights as for what ever reason quite some files (such as pictures or office documents) are marked executable. So in reality the script above has several arrays with file extensions concatenated,
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