GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
STRING-PAD(1) fish-shell STRING-PAD(1)

string-pad - pad strings to a fixed width

string pad [(-r | --right)] [(-c | --char) CHAR] [(-w | --width) INTEGER] [STRING...]


string pad extends each STRING to the given width by adding CHAR to the left.

If -r or --right is given, add the padding after a string.

If -c or --char is given, pad with CHAR instead of whitespace.

The output is padded to the maximum width of all input strings. If -w or --width is given, use at least that.

>_ string pad -w 10 abc abcdef
       abc
    abcdef
>_ string pad --right --char=🐟 "fish are pretty" "rich. "
fish are pretty
rich.  🐟🐟🐟🐟
>_ string pad -w$COLUMNS (date)
# Prints the current time on the right edge of the screen.


The printf command can do simple padding, for example printf %10s\n works like string pad -w10.

2021, fish-shell developers
April 9, 2022 3.3

Search for    or go to Top of page |  Section 1 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.