awk RS - Record Separator


Example

Used by awk to split the input into multiple records. For example:

echo "a b c|d e f" | awk 'BEGIN {RS="|"} {print $0}'

produces:

a b c
d e f

By default, the record separator is the newline character.

Similarly: echo "a b c|d e f" | awk 'BEGIN {RS="|"} {print $2}'

produces:

b
e