bug-gnulib
[Top][All Lists]
Advanced

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

Re: shell variable references - coding style


From: Paul Eggert
Subject: Re: shell variable references - coding style
Date: Wed, 13 Mar 2019 10:15:40 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1

On 3/13/19 5:46 AM, Pavel Raiskup wrote:
>
> Is there a gnulib/GNU-preferred way to do this, defined somewhere?

Not that I'm aware of. Opinions differ. I tend to agree more with Jim
Meyering, and prefer a quoting style like this:

    save_IFS=$IFS
    for arg
    do
      IFS=$save_IFS
      [Some more code]
    done
    IFS=$save_IFS

to the "quotier" style where each assignment's right hand side is
surrounded by double-quotes. Although the style I prefer assumes a bit
more expertise with shell syntax, in my experience the expertise is
needed anyway.

I wouldn't go through shell scripts and systematically change one style
to another; life is too short.




reply via email to

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