Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Truncate without padding



    Hi all :)

    I would like to print a string truncated *but* without padding,
so I cannot use the "l" and "r" parameter expansion flags. Of course,
I could use the "%" parameter expansion flag and use %>STRING>, but I
don't want the string to be prompt-expanded.

    I know I can use "printf" or "zformat" for that, but I was
wondering if this can be done using "print" and some form of
expansion. I need to use "print" because sometimes I have to do
translation of echo escape sequences and sometimes not, and I've
implemented that using optionally the "-r" option to "print". I can
switch to printf and do any translation before, but I would like to
use the current code and not switch to printf or zformat.

    Thanks a lot in advance :)

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
http://www.pleyades.net & http://www.gotesdelluna.net
It's my PC and I'll cry if I want to...



Messages sorted by: Reverse Date, Date, Thread, Author