Timeline for Sed - Help Matching with Multi-Line Match
Current License: CC BY-SA 4.0
7 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| May 11 at 12:02 | vote | accept | adam | ||
| May 11 at 12:02 | |||||
| May 10 at 20:31 | comment | added | JoL |
Why s|\(.*\)\(.*\)|\1\2? Why not just s/$/[etc]\ntransient = true\n/, like OP had done? Also, . can match newlines even when not using -z. You can verify that with sed 'N;s/.*/<&>/' <<< $'foo\nbar'
|
|
| May 10 at 17:49 | history | edited | jesse_b | CC BY-SA 4.0 |
deleted 15 characters in body
|
| May 10 at 14:39 | history | edited | terdon♦ | CC BY-SA 4.0 |
added 1 character in body
|
| May 10 at 13:54 | comment | added | Kusalananda♦ |
Alternative grep pipeline to detect existing text: grep -xF -A 1 '[etc]' file | grep -q -xF 'transient = true'
|
|
| May 10 at 12:53 | history | edited | jesse_b | CC BY-SA 4.0 |
added 1 character in body
|
| May 10 at 12:40 | history | answered | jesse_b | CC BY-SA 4.0 |