[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Read the input as a whole
From: |
Peng Yu |
Subject: |
Read the input as a whole |
Date: |
Fri, 11 Jun 2021 09:06:46 -0500 |
Hi,
Both of the following commands can read a whole input. Are they always
the same under all possible input? Is there one preferred over the
other?
$ builtin printf '%s\n%s' abc 123 | awk.sh -e 'BEGIN { RS=""; getline;
print $0 }'
abc
123
$ builtin printf '%s\n%s\n' abc 123 | awk.sh -e 'BEGIN { RS="^$";
getline; print $0 }'
abc
123
--
Regards,
Peng
- Read the input as a whole,
Peng Yu <=