Awk null data option

awk, grep, null

Solution

You can set `RS` (the record separator) to change how `awk` views lines. This would be set in a similar manner to the field separator `FS`. Depending on the version of `awk` you are using you may be able to set this to NULL.

For example,

awk '{ print $0 }' RS="\0" file

Note that this may not be portable if you are not using the GNU awk implementation.

Problem

With `grep`, you have a `--null-data` option ``` -z, --null-data a data line ends in 0 byte, not newline ``` In this way a line is a string ending with a null character, instead of a newline. Does `awk` have a similar option?

Original source