On Thu, Sep 24, 2020 at 2:49 PM HAGIO KAZUHITO(萩尾 一仁)
<k-hagio-ab(a)nec.com> wrote:
Hello Kairui,
-----Original Message-----
> Replace $(cat ...) with $(< ...) which help improve the performance.
>
> Signed-off-by: Kairui Song <kasong(a)redhat.com>
> ---
> dracut-module-setup.sh | 6 +++---
> kdump-lib.sh | 10 +++++-----
> kdumpctl | 6 +++---
> mkdumprd | 3 +--
> 4 files changed, 12 insertions(+), 13 deletions(-)
>
> diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
> index a186570..6a13f53 100755
> --- a/dracut-module-setup.sh
> +++ b/dracut-module-setup.sh
> @@ -94,7 +94,7 @@ kdump_setup_dns() {
> _dns=$(echo $_nameserver | cut -d' ' -f2)
> [ -z "$_dns" ] && continue
>
> - if [ ! -f $_dnsfile ] || [ ! $(cat $_dnsfile | grep -q $_dns) ]; then
> + if [ ! -f $_dnsfile ] || [ ! $(< $_dnsfile | grep -q $_dns) ]; then
Does this pipeline pattern work expectedly?
Hi, thanks very much for catching this issue, I didn't notice this in
my sanity check, the syntax is not working here. For such usage, cat
could be avoided by appending the filename to the grep/awk call. I'll
update the patch.
--
Best Regards,
Kairui Song