public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tools/bootconfig: fix single & used for logical condition
Date: Fri, 20 Jan 2023 07:49:10 +0900	[thread overview]
Message-ID: <20230120074910.966fdeea1fe670c25be7670d@kernel.org> (raw)
In-Reply-To: <20230112114215.17103-1-antonio.feijoo@suse.com>

On Thu, 12 Jan 2023 12:42:15 +0100
Antonio Alvarez Feijoo <antonio.feijoo@suse.com> wrote:

> A single & will create a background process and return true, so the grep
> command will run even if the file checked in the first condition does not
> exist.
> 

Good catch!

Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>

Thank you!

> Signed-off-by: Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
> ---
>  tools/bootconfig/scripts/ftrace2bconf.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/bootconfig/scripts/ftrace2bconf.sh b/tools/bootconfig/scripts/ftrace2bconf.sh
> index 6183b36c6846..1603801cf126 100755
> --- a/tools/bootconfig/scripts/ftrace2bconf.sh
> +++ b/tools/bootconfig/scripts/ftrace2bconf.sh
> @@ -93,7 +93,7 @@ referred_vars() {
>  }
>  
>  event_is_enabled() { # enable-file
> -	test -f $1 & grep -q "1" $1
> +	test -f $1 && grep -q "1" $1
>  }
>  
>  per_event_options() { # event-dir
> -- 
> 2.35.3
> 


-- 
Masami Hiramatsu (Google) <mhiramat@kernel.org>

      reply	other threads:[~2023-01-20  5:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-12 11:42 [PATCH] tools/bootconfig: fix single & used for logical condition Antonio Alvarez Feijoo
2023-01-19 22:49 ` Masami Hiramatsu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230120074910.966fdeea1fe670c25be7670d@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=antonio.feijoo@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox