3 ms·
> sed '1,/$ base64/d;/$ exit/,$d' ssh.txt Huh. I'm surpised this works, because $ is not escaped.
by jwilk 6y ago
> sed '1,/$ base64/d;/$ exit/,$d' ssh.txt
Huh. I'm surpised this works, because $ is not escaped.
- formerly_proven 6y agoSingle quotes.
- jwilk 6y agoNo, I mean $ usually means end-of-string (or end-of-line) in regexps. But TIL in BREs, $ means literal character in the middle of an expression: https://pubs.opengroup.org/onlinepubs/007904975/basedefs/xbd_chap09.html#tag_09_03_08 https://pubs.opengroup.org/onlinepubs/007904975/basedefs/xbd...
- formerly_proven 6y agoOh I see now, I never thought about $ being usable anywhere except at the end as an anchor!