Hitachi

Job Management Partner 1 Version 10 Job Management Partner 1/Advanced Shell Description, User's Guide, Reference, and Operator's Guide


5.1.9 Escape characters

Organization of this subsection

(1) List of escape characters

The echo and print commands interpret the characters listed in the following table as escape characters:

Escape character

Meaning

echo command

print command

\a

Alert character (bell)

Y

Y

\b

Backspace character

Y

Y

\c

Suppresses the linefeed character at the end of a line (characters following \c are not output)

Y

Y

\f

Formfeed character (page break)

Y

Y

\n

Linefeed character

Y

Y

\r

Carriage return character

Y

Y

\t

Tab character

Y

Y

\v

Vertical tab character

Y

Y

\0nnn#1

ASCII character represented by one, two, or three octal digits (0 to 7)

Y

Y

\xnn#2

ASCII character represented by one or two hexadecimal digits (0 to 9, a to f, A to F)

Y

N

\\

A single backslash character

Y

Y

Legend:

Y: Can be specified.

N: Cannot be specified.

#1

If a specified ASCII character consists of one or two digits and two or one leading zeros, respectively, are added to make it three digits, the ASCII character will still be treated as consisting of only one or two digits. For example, the following three specifications are all interpreted as being the same, in which case the alert character (bell) is output three times:

echo -e "\07"

echo -e "\007"

echo -e "\0007"

#2

Enabled only when YES is specified in the ESCAPE_SEQ_ECHO_HEX environment setting parameter. For details about the ESCAPE_SEQ_ECHO_HEX parameter, see ESCAPE_SEQ_ECHO_HEX parameter (specifies whether ASCII code characters in hexadecimal notation are to be interpreted as escape characters) in 7. Parameters Specified in the Environment Files.

If a specified ASCII character consists of one digit and a leading zero is added to make it two digits, the ASCII character will still be treated as consisting of only one digit. For example, the following two specifications are interpreted as being the same, in which case the linefeed character is output twice:

echo -e "\xA"

echo -e "\x0A"

(2) Handling of the echo command with neither -e nor -E option specified

If neither the -e option (interprets escape characters) nor the -E option (does not interpret escape characters) is specified in the echo command, the handling of escape characters depends on the setting in the ESCAPE_SEQ_ECHO_DEFAULT environment parameter. For details about the ESCAPE_SEQ_ECHO_DEFAULT environment parameter, see ESCAPE_SEQ_ECHO_DEFAULT parameter (defines the action of the echo command when the escape-character option is omitted) in 7. Parameters Specified in the Environment Files.