11.2.1 Notes about the row numbers that are output in messages
The following notes apply to the row numbers that are output in messages KNAX6000-E through KNAX6100-E, KNAX6710-I through KNAX6712-E, and KNAX6998-E.
-
If a command error occurs in a command substitution spanning multiple lines, the last line number in the command substitution is displayed in the message as the erroneous line number.
Example:
If an error occurs in unset command in the following code, the erroneous line is shown as line number 3:
1: `unset 2: echo pwd 3: `
-
If an error occurs during syntax analysis of an external script, the name of the job definition script that called the external script is output in the error message as the job definition script file name. The line whose number is displayed is the line in the job definition script where the external script was called.
-
If a syntax or command error occurs while the trap command's action is running, the line number of the trap command is displayed in the message as the erroneous line number.
Example 1:
This example spans multiple lines. The erroneous line is shown as line number 1.
1: trap 'pwd 2: unset 3: date' INT
Example 2:
This example calls a function. The erroneous line is shown as line number 4.
1: func1() { 2: unset 3: } 4: trap func1 INT