[PATCH] scripts: coccicheck: Use /usr/bin/env

Jarkko Sakkinen posted 1 patch 2 years, 7 months ago
scripts/coccicheck | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] scripts: coccicheck: Use /usr/bin/env
Posted by Jarkko Sakkinen 2 years, 7 months ago
If bash is not located under /bin, coccicheck fails to run.  In the real
world, this happens for instance when NixOS is used in the host.  Instead,
use /usr/bin/env to locate the executable binary for bash.

Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
---
 scripts/coccicheck | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/coccicheck b/scripts/coccicheck
index 2956fce8fa4f..b4d0d6eb3e73 100755
--- a/scripts/coccicheck
+++ b/scripts/coccicheck
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 # SPDX-License-Identifier: GPL-2.0
 # Linux kernel coccicheck
 #
-- 
2.38.1
Re: [PATCH] scripts: coccicheck: Use /usr/bin/env
Posted by Julia Lawall 2 years, 6 months ago

On Thu, 26 Jan 2023, Jarkko Sakkinen wrote:

> If bash is not located under /bin, coccicheck fails to run.  In the real
> world, this happens for instance when NixOS is used in the host.  Instead,
> use /usr/bin/env to locate the executable binary for bash.
>
> Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>

Applied, thanks.

julia

> ---
>  scripts/coccicheck | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/coccicheck b/scripts/coccicheck
> index 2956fce8fa4f..b4d0d6eb3e73 100755
> --- a/scripts/coccicheck
> +++ b/scripts/coccicheck
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  # SPDX-License-Identifier: GPL-2.0
>  # Linux kernel coccicheck
>  #
> --
> 2.38.1
>
>