Timeline for The differences between sed #, %, / and |
Current License: CC BY-SA 3.0
14 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Mar 15, 2021 at 20:19 | history | edited | Quasímodo | edited tags | |
| Jun 4, 2017 at 23:23 | comment | added | Stickers | @SatoKatsura Thanks so much the explanation, it helped a lot. | |
| Jun 4, 2017 at 23:21 | vote | accept | Stickers | ||
| Jun 4, 2017 at 21:37 | comment | added | Stickers | @ilkkachu Yes, both # and % worked without any issues. | |
| Jun 4, 2017 at 21:34 | history | edited | Stickers | CC BY-SA 3.0 | deleted 36 characters in body |
| Jun 4, 2017 at 20:59 | comment | added | Satō Katsura | (1) Your problem has nothing to do with regex escaping. It has to do with you using shell special characters without escaping them. You can solve that by enclosing s|...|g etc. in single quotes. You don't need double quotes for the URLs. (2) s/.../g has the leaning toothpick syndrome, because the delimiter / for s is also found in http:// and in the paths separators. (3) There is no difference in using #, %, or | as delimiters for sed, they're just alternative solutions to the leaning toothpick problem. Any other "spare" character would do. (4) man sed, man bash. | |
| Jun 4, 2017 at 17:18 | comment | added | ilkkachu | @Pangloss, you added the % version later, didn't it work? | |
| Jun 4, 2017 at 16:14 | history | edited | Stickers | CC BY-SA 3.0 | added 10 characters in body; edited title |
| Jun 4, 2017 at 16:10 | comment | added | Stickers | @SatoKatsura Now I know the issue is mainly caused by regex escaping, if I quote everything like 's|'"http://a.com"'|'"http://b.com"'|g' any of the line above will work, but the question still remains open, what are the difference between #, %, / and |? | |
| Jun 4, 2017 at 16:01 | history | edited | Stickers | CC BY-SA 3.0 | added 94 characters in body; edited title |
| Jun 4, 2017 at 15:19 | comment | added | Satō Katsura | See leaning toothpick syndrome. | |
| Jun 4, 2017 at 15:10 | answer | added | Jeff Schaller♦ | timeline score: 5 | |
| Jun 4, 2017 at 15:04 | comment | added | Satō Katsura | The way you wrote it, all of them are syntax errors. :) If you add single quotes around s...g, then only the second is a syntax error. Neither problem has anything to do with find. | |
| Jun 4, 2017 at 14:58 | history | asked | Stickers | CC BY-SA 3.0 |