truncate - UDM Command

Syntax

truncate variable_name length=_length

Description

The truncate command truncates a string to a specific length.

The first parameter, variable_name, is the name of an existing variable or list element to truncate. The length parameter specifies the length to which the string is truncated.

Parameters

Parameter

Description

variable_name

Name of the existing variable or list element to truncate.

length=length

Length to which the string truncates.

Examples

The following examples assume that a variable, mystring, exists with a beginning value of 12345789.

truncate mystring length=4
echo "$(mystring)"
1234

truncate mystring length=8
echo "$(mystring)"
12345678