Quote sed
codes with double quotes:
$ sed "s/ones/one's/"<<<"ones thing"
one's thing
I don’t like escaping codes with hundreds of backslashes – hurts my eyes. Usually I do in this way:
$ sed 's/ones/one\x27s/'<<<"ones thing"
one's thing
Related Contents:
- How can I replace each newline (\n) with a space using sed?
- What is the difference between sed and awk? [closed]
- Escape a string for a sed replace pattern
- Change multiple files
- Insert a line at specific line number with sed or awk
- sed fails with “unknown option to `s'” error [closed]
- How to insert strings containing slashes with sed? [duplicate]
- how to parse a JSON String with jq (or other alternatives)?
- Add text at the end of each line
- How to remove trailing whitespaces with sed?
- Have sed ignore non-matching lines
- Linux shell command to filter a text file by line length
- How to find and replace all occurrences of a string recursively in a directory tree? [duplicate]
- sed delete lines not containing specific string
- .bash_profile sed: \1 not defined in the RE
- Swap two columns – awk, sed, python, perl
- How to use SED to find and replace URL strings with the “/” character in the targeted strings? [duplicate]
- Remove non-ASCII characters from CSV
- Remove all lines before a match with sed
- How to use awk to print lines where a field matches a specific string?
- Combining two sed commands
- Replace all double quotes with single quotes
- How do I run the sed command with input and output as the same file?
- sed command in dry run
- sed, replace first line
- Using different delimiters in sed commands and range addresses
- How to globally replace strings in lines NOT starting with a certain pattern
- How to use sed to remove all double quotes within a file
- How to remove every other line with sed?
- delete a column with awk or sed
- Using different delimiters in sed commands and range addresses
- Bash tool to get nth line from a file
- How can I escape square brackets in a LIKE clause?
- Java: Literal percent sign in printf statement
- sed or awk: delete n lines following a pattern
- When to use ‘ (or quote) in Lisp?
- Escape double quote character in XML
- How do I delete all lines in a file starting from after a matching line?
- PowerShell script not accepting $ (dollar) sign
- Escape angle brackets in a Windows command prompt
- Using sed to delete all lines between two matching patterns
- How to escape < and > inside tags
- How to include an ampersand (&) in the content of a ComboBoxItem
- Why do backslashes appear twice?
- what’s the escape sequence for hyphen (-) in PostgreSQL
- Why doesn’t `\d` work in regular expressions in sed? [duplicate]
- Sed gives: sed: can’t read : No such file or directory
- Removing non-alphanumeric characters with sed
- Can not extract the capture group with either sed or grep
- How to insert a string which contains an “&”