Previous slide Next slide Back to the first slide View text version


Notes:

This slide illustrates the record and field parsing awk performs.

Awk splits a records, reading one at a time, and on each pass assigns that record to $0. By default, RS is assigned by default the newline (\n). You have the option to assign RS your own value.

After $0 has been assigned the respective record, it will then split the record into positional parameters. By default, the field separator is white space; which can be any combination of spaces and tabs. You can assign a different value to designate the field separator. For example you can assign FS=“:” when the colon character serves as the field separator.

We’ll see some examples of reassigning these values later.

After understanding how records and records are parsed, the following becomes much clearer in the awk process: