Re: 'safe' printing to the terminal
[email protected] (Michiel Beijen) Mon, 11 May 2026 15:34:39 +0000
| Newsgroups | perl.perl5.porters |
|---|---|
| Message-ID | <ZPDOD3qvzy-uYFT2OgWsP2LIwSkdhsGSP_Sd1EukQRvIM4yoYcBGVQPm9MlISFq0QmU0wQX7Olyeq61_cCbMRIc_PElttUWyKE2xe5Ed5_M=@x14.nl> |
On Monday, May 11th, 2026 at 12:29, "Ruud H.G. van Tol" via perl5-porters <[email protected]> wrote: > printf has %q: > > $ printf -v var "%q" "^[[4mtest^[[m" > > $ echo $var > > $ eval "echo $var" Yeah, that does what I want, but unfortunately this is not available in _perl_ printf, only in _bash_ printf. Still looking for advise on how to print 'untrusted' input to a TTY in a way that is sane! -- Michiel