Is there a field that stores the exact field separator FS used when in a regular expression, equivalent to RT for RS?
问题 In GNU Awk's 4.1.2 Record Splitting with gawk we can read: When RS is a single character, RT contains the same single character. However, when RS is a regular expression, RT contains the actual input text that matched the regular expression. This variable RT is very useful in some cases. Similarly, we can set a regular expression as the field separator. For example, in here we allow it to be either ";" or "|": $ gawk -F';' '{print NF}' <<< "hello;how|are you" 2 # there are 2 fields, since ";"