Great point. Most of my sed commands were reproducing entire original lines just to add ! or indent them. A better approach:
- Channel direction
!/?additions: small substitutions likes/screen)/screen!)/— already minimal, fine. ...→20: already minimal, fine.- PROC life wrapper: instead of replacing all 16 lines with their indented copies, just insert the PROC header, indent the range by 2 spaces, substitute
terminal.keyboard→keyboard/terminal.screen→screen, and append the closing:\n. - clear.screen / move.cursor: the originals use
write.string/write.formatted/DATA.ITEMwhich are deleted and replaced with entirely new code — no original content in the replacements. - Header and helper procs: entirely new text.
Let me write a cleaner script using this approach.