|
| |||||||||
| Tags: command line, linux, operating system, sed, stream editor, terminal |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| SED with quotes
Hello, I would like to replace a file option. This option is as follows: Code: OPTION = "TRUE" Code: sed-i-e 's / OPTION = "TRUE" / OPTION = "FALSE" / g' / etc / file |
|
#2
| |||
| |||
| Re: SED with quotes
Hi Code: sed-i-e 's / OPTION = "TRUE" / OPTION = "FALSE" / g' / etc / file Code: sed 's / OPTION = \ "true \" / OPTION = \ "false \" / g' |
|
#3
| |||
| |||
| Re: SED with quotes
Hi, Quote:
Quote:
|
|
#4
| |||
| |||
| Re: SED with quotes
Hi Well we may not be quite using the same version of sed, But for information I just create a file with contents test.txt Code: OPTION = "TRUE" Code: sed-i-e 's / OPTION = \ "true \" / OPTION = \ "false \" / g' test.txt |
|
#5
| |||
| |||
| Re: SED with quotes
Hello On a simple option that works: Code: OPTION = "TRUE" Code: OPTION = "-u user-p password" Code: OPTION = "-u test-p tty" |
|
#6
| ||||
| ||||
| Re: SED with quotes
Hello, Sed uses the delimiter called slash. For sed that does not confuse them with slashes of chemisn delimiter, it must be protected in the same manner as other special characters. Code: sed-i-e 's / = OPTION \ "-u test-p password-h \ / var \ / lib \ / test \" / OPTION = \ |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "SED with quotes" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Best Video Game quotes | Weslee | Video Games | 9 | 03-01-2012 10:29 PM |
| Need help with Morningstar Quotes for Firefox 5 | Merka | Technology & Internet | 5 | 27-06-2011 11:28 PM |
| What are Magic Quotes in PHP? | Rob Dizzle | Software Development | 5 | 05-03-2010 12:33 AM |
| Regex string with quotes | Gunner 1 | Software Development | 5 | 07-02-2010 06:03 AM |
| How to embed quotes in t-sql | joel84 | Software Development | 3 | 03-08-2009 04:01 PM |