Padding a string with zsh
07 Apr 2023To pad a string with leading spaces in zs, you can use ${(r(15)( ))variableName).
r(15)pads on theright (uselforleft padding)- The
15defines the maximum length of the string ( )defines the character to use for padding (here, aspace)
Want to add something ? Feel free to get in touch on Bluesky : @pixelastic.bsky.social