Last active
August 12, 2026 21:12
-
-
Save emanuele6/4bf94faca24143db02175dbe7a434c93 to your computer and use it in GitHub Desktop.
POSIX ed script that adds a | to the middle of every line (round down)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| g/^/s/.*/a&a/\ | |
| s/^\(.\(..\)*\)$/b\1/\ | |
| t -\ | |
| s/^/X/ | |
| 2s/../Y\ | |
| /g | |
| 2,$g/^X/+s/../%/g | |
| g/^Y/?^[Xx]?t .\ | |
| s/.\(.*\)./x\1/\ | |
| ?^[Xy]?t .\ | |
| s/../y/ | |
| g/^X/;/^$/-3d\ | |
| s/^.b\{,1\}.\(.*\)/\1|/\ | |
| +s/.\(.*\).$/\1/\ | |
| -,+j | |
| w | |
| q |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment