Home - Resumé - Up


Name

pad - pad input lines to a minimum width

Synopsis

pad [−clr] [−p padding] [−w width] [file ...]

Description

Pad copies its input to its output, padding each line to a minimum width. Lines longer than that width are left unchanged; see also crop(1) .

The options are as follows:

−c
Center the input, padding on both sides.

−l
Left align the input, padding on the right. This is the default.

−p padding
Specifies a padding string, which is repeated to fill lines out to the minimum width. Without a −p flag, pad fills lines with blanks.

−r
Right align the input, padding on the left.

−w width
Pad lines to width.

If no width is explicitly specified, and the standard error is connected to a terminal, then pad tries to determine its width, first by querying the terminal driver, and failing that by examining the COLUMNS environment variable. If neither method succeeds, or if the standard error is not a terminal, then width defaults to 80 columns.

Environment

COLUMNS
If the standard error is connected to a terminal, and pad fails cannot obtain the terminal width from the driver, then the value of COLUMNS will be taken as the output width.

Bugs

Pad does not yet understand backspace and tab, or multibyte characters.

See Also

crop(1), tty(4)