Default field separator for awk

后端 未结 3 1855
天涯浪人
天涯浪人 2020-12-08 03:09

Sorry for this stupid question, searched but not confident is the right answer is found, so the default separator is only space for awk?

3条回答
  •  不思量自难忘°
    2020-12-08 03:35

    Let's take a look at the GNU awk man page:

    FS — The input field separator, a space by default. See Fields, above.

    To the Fields section!

    As each input record is read, gawk splits the record into fields, using the value of the FS variable as the field separator. If FS is a single character, fields are separated by that character. If FS is the null string, then each individual character becomes a separate field. Otherwise, FS is expected to be a full regular expression. In the special case that FS is a single space, fields are separated by runs of spaces and/or tabs and/or newlines.

提交回复
热议问题