lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] [lmi-commits] master 66fe46b 03/18: Resolve more shellcheck "S


From: Vadim Zeitlin
Subject: Re: [lmi] [lmi-commits] master 66fe46b 03/18: Resolve more shellcheck "SC1117" warnings
Date: Thu, 30 May 2019 01:10:10 +0200

On Wed, 29 May 2019 18:49:07 -0400 (EDT) Greg Chicares <address@hidden> wrote:

GC> branch: master
GC> commit 66fe46b85a63a552925fcc4b4d300034265c22fe
GC> Author: Gregory W. Chicares <address@hidden>
GC> Commit: Gregory W. Chicares <address@hidden>
GC> 
GC>     Resolve more shellcheck "SC1117" warnings
GC>     
GC>     Commit e91fdebd1 purported to resolve "all" such warnings, but at that
GC>     time shellcheck had been run only on scripts in the src/ directory.
GC>     Today, fixed scripts in subdirectories, makefiles, and flat-text files
GC>     as well.

 In addition to my opinion about the usefulness of SC1117 already expressed
in a previous reply, I'd like to ask why did you decide to make several
changes of this form:

GC> diff --git a/gwc/develop2.txt b/gwc/develop2.txt
GC> index b6fb180..db594a1 100644
GC> --- a/gwc/develop2.txt
GC> +++ b/gwc/develop2.txt
GC> @@ -85,7 +85,7 @@ printf "forcing correct permissions "
GC>         printf "$d..." \
GC>      && find ./$d -maxdepth 1 -type f -not -name '*.sh' -not -name '*.sed' 
| xargs chmod -x \
GC>    )done; \
GC> -printf "all permissions forced\n"
GC> +printf '%s\n' "all permissions forced"

I.e. replacing

        printf "foo bar\n"

with

        printf '%s\n' "foo bar"

when it would seem that

        printf 'foo bar\n'

would work just as well and be shorter and easier to read and understand?
Should this really be done for all the future uses of printf in shell
scripts? Personally I find such use of "%s" very strange and don't see what
do we gain from it. Could you please explain why is it used?

 Thanks in advance!
VZ

Attachment: pgpKtmvv5Vm5Y.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]