Hitachi

JP1 Version 11 JP1/Advanced Shell Description, User's Guide, Reference, and Operator's Guide 


10.3.5 deleteSpace (gets the character string without space)

Syntax

deleteSpace  [-a] [-l] [-r]  character-string

Description

This command outputs the character string that space is deleted from the character string specified for argument. Space is the character indicated with the regular expression [:space:]. Space includes half-width space and tab.

Arguments

-a

This command deletes all spaces included in the character string.

-l

This command deletes only the space at the beginning of the character string.

-r

This command deletes only the space at the end of the character string.

If you do not specify any options, spaces at the beginning and end of the character string are deleted. This is the same behavior as when -l option and -r option are specified.

-If you specify the -a option with other option at the time, the -a option is prioritized.

character-string

This command specifies the character string from which space is deleted.

Output to the standard output

Character string that space is deleted.

Return codes

Return code

Meaning

0

Normal termination

Not less than 1

Termination with an error

Examples

deleteSpace "  ab  cd  "         # "ab  cd" is output.
deleteSpace -l "  ab  cd  "      # "ab  cd  " is output.
deleteSpace -r "  ab  cd  "      # "  ab  cd" is output.
deleteSpace -a "  ab  cd  "      # "abcd" is output.