diff mbox series

[v2,07/18] tests/multiboot: Improve portability by searching bash in the $PATH

Message ID 20190129175403.18017-8-philmd@redhat.com (mailing list archive)
State New, archived
Headers show
Series OpenBSD: Enable qtesting | expand

Commit Message

Philippe Mathieu-Daudé Jan. 29, 2019, 5:53 p.m. UTC
Bash is not always installed as /bin/bash. In particular on OpenBSD,
the package installs it in /usr/local/bin.
Use the 'env' shebang to search bash in the $PATH.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 tests/multiboot/run_test.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kamil Rytarowski Jan. 29, 2019, 6:10 p.m. UTC | #1
On 29.01.2019 18:53, Philippe Mathieu-Daudé wrote:
> Bash is not always installed as /bin/bash. In particular on OpenBSD,
> the package installs it in /usr/local/bin.
> Use the 'env' shebang to search bash in the $PATH.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Reviewed-by: Kamil Rytarowski <n54@gmx.com>

> ---
>  tests/multiboot/run_test.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/multiboot/run_test.sh b/tests/multiboot/run_test.sh
> index 6c33003e71..a88e423992 100755
> --- a/tests/multiboot/run_test.sh
> +++ b/tests/multiboot/run_test.sh
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#! /usr/bin/env bash
>  
>  # Copyright (c) 2013 Kevin Wolf <kwolf@redhat.com>
>  #
>
Eric Blake Jan. 29, 2019, 10:16 p.m. UTC | #2
On 1/29/19 11:53 AM, Philippe Mathieu-Daudé wrote:
> Bash is not always installed as /bin/bash. In particular on OpenBSD,
> the package installs it in /usr/local/bin.
> Use the 'env' shebang to search bash in the $PATH.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  tests/multiboot/run_test.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/multiboot/run_test.sh b/tests/multiboot/run_test.sh
> index 6c33003e71..a88e423992 100755
> --- a/tests/multiboot/run_test.sh
> +++ b/tests/multiboot/run_test.sh
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#! /usr/bin/env bash

Again, why the space after #!? Having or omitting it makes no
difference, but the prevailing style is to omit it.

Reviewed-by: Eric Blake <eblake@redhat.com>
diff mbox series

Patch

diff --git a/tests/multiboot/run_test.sh b/tests/multiboot/run_test.sh
index 6c33003e71..a88e423992 100755
--- a/tests/multiboot/run_test.sh
+++ b/tests/multiboot/run_test.sh
@@ -1,4 +1,4 @@ 
-#!/bin/bash
+#! /usr/bin/env bash
 
 # Copyright (c) 2013 Kevin Wolf <kwolf@redhat.com>
 #