pad - UDM Command

Syntax

pad variable_name length=length [seq=sequence]

Description

The pad command takes a string in an existing variable or list element and pads it to make it the given length. If the string already is longer than the specified length, it is not padded.

The first parameter, variable_name, is the name of an existing variable or list element to pad. The length parameter specifies the desired length of the padded string.

The optional seq parameter specifies the sequence that is used for padding the string; if seq is not specified, a space is used.

Parameters

Parameter

Description

variable_name

Name of an existing variable or list element to pad

length=length

Desired length of the padded string.

seq=sequence

Sequence used for padding the string.

Examples

The following examples use a predefined string, mystring, with a starting value of This is a test.

pad mystring length=20
echo "$(mystring) TheEnd"
This is a test      TheEnd

pad mystring length=20 seq="-"
echo "$(mystring)"
This is a test------