diff mbox series

[5/7] configure: Remove use of backtick `...` syntax

Message ID 20220825150703.4074125-6-peter.maydell@linaro.org
State Superseded
Headers show
Series configure: fix misc shellcheck warnings | expand

Commit Message

Peter Maydell Aug. 25, 2022, 3:07 p.m. UTC
There's only one place in configure where we use `...` to execute a
command and capture the result.  Switch to $() to match the rest of
the script. This silences a shellcheck warning.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Philippe Mathieu-Daudé Aug. 30, 2022, 12:13 p.m. UTC | #1
On 25/8/22 17:07, Peter Maydell wrote:
> There's only one place in configure where we use `...` to execute a
> command and capture the result.  Switch to $() to match the rest of
> the script. This silences a shellcheck warning.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>   configure | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/configure b/configure
> index d5b6546ae81..5c1992d5bce 100755
> --- a/configure
> +++ b/configure
> @@ -2317,7 +2317,7 @@ LINKS="$LINKS python"
>   LINKS="$LINKS contrib/plugins/Makefile "
>   for f in $LINKS ; do
>       if [ -e "$source_path/$f" ]; then
> -        mkdir -p `dirname ./$f`
> +        mkdir -p "$(dirname ./"$f")"

Nitpicking, easier to read as "$(dirname ./${f})"

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

>           symlink "$source_path/$f" "$f"
>       fi
>   done
Peter Maydell Sept. 22, 2022, 2:14 p.m. UTC | #2
On Tue, 30 Aug 2022 at 13:13, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> On 25/8/22 17:07, Peter Maydell wrote:
> > There's only one place in configure where we use `...` to execute a
> > command and capture the result.  Switch to $() to match the rest of
> > the script. This silences a shellcheck warning.
> >
> > Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> > ---
> >   configure | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/configure b/configure
> > index d5b6546ae81..5c1992d5bce 100755
> > --- a/configure
> > +++ b/configure
> > @@ -2317,7 +2317,7 @@ LINKS="$LINKS python"
> >   LINKS="$LINKS contrib/plugins/Makefile "
> >   for f in $LINKS ; do
> >       if [ -e "$source_path/$f" ]; then
> > -        mkdir -p `dirname ./$f`
> > +        mkdir -p "$(dirname ./"$f")"
>
> Nitpicking, easier to read as "$(dirname ./${f})"

That would be missing the quoting on the inner level, I think.

-- PMM
diff mbox series

Patch

diff --git a/configure b/configure
index d5b6546ae81..5c1992d5bce 100755
--- a/configure
+++ b/configure
@@ -2317,7 +2317,7 @@  LINKS="$LINKS python"
 LINKS="$LINKS contrib/plugins/Makefile "
 for f in $LINKS ; do
     if [ -e "$source_path/$f" ]; then
-        mkdir -p `dirname ./$f`
+        mkdir -p "$(dirname ./"$f")"
         symlink "$source_path/$f" "$f"
     fi
 done