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

Re: create variable with calculated number of spaces.





On 2024-05-06 15:38, Mark J. Reed wrote:
or, more efficiently:

    printf -v spacer "%${diff}s" ''
Nice and compact.  One thing tho, I'm not sure this is the correct way to think, but I have an instinct to stay away from 'fancy' commands like printf and to rely on native zsh code where possible.  Legit?  Or false frugality?  What I half-remember is some loop that has an iteration counter.  Mind, there was one of Roman's speed tests where he used an external command and had a huge performance improvement, so thereyago.





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