Field Variables
Field variables represent the fields of the current line.
As each input line is read, it is split into fields using the values of the IFS built-in variable as the field separator. Each field in the input line may be referenced by its position, $1, $2, and so on. The built-in variable NF contains the number of fields split from the current input line. References to non-existent fields (i.e., fields after NF) produce the null-string.
In addition, a group/range of characters within a field variable can be accessed by specifying the position in parenthesis following the field variable. The position of the first character in a field variable is 1; the second character is position 2, and so on. To specify a group/range of characters, the beginning and ending positions of the characters should be included within the parenthesis. This is true even if there is only one character in the range. The beginning and ending positions should be separated by one space.
Examples
Last modified date: 02/01/2024