reproduce-devel
[Top][All Lists]
Advanced

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

[task #15706] Why not use curly brackets for generic shell or bash varia


From: Boud Roukema
Subject: [task #15706] Why not use curly brackets for generic shell or bash variables?
Date: Tue, 23 Jun 2020 10:44:58 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0

URL:
  <https://savannah.nongnu.org/task/?15706>

                 Summary: Why not use curly brackets for generic shell or bash
variables?
                 Project: Reproducible paper template
            Submitted by: boud
            Submitted on: Tue 23 Jun 2020 02:44:57 PM UTC
         Should Start On: Tue 23 Jun 2020 12:00:00 AM UTC
   Should be Finished on: Tue 23 Jun 2020 12:00:00 AM UTC
                Category: None
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
        Percent Complete: 0%
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
                  Effort: 0.00

    _______________________________________________________

Details:

It appears that a shell satisfying POSIX.1-2017 standards must correctly
process

${expression}

and

${parameter}


See
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_02

It seems to be a general recommendation to write ${parameter} rather than
$parameter:
https://stackoverflow.com/questions/8748831/when-do-we-need-curly-braces-around-shell-variables#8748880

There are also recommendations to use double quotes:
https://unix.stackexchange.com/questions/4899/var-vs-var-and-to-quote-or-not-to-quote

Do we have any good reasons _not_ to use {} around parameter names in either
(i) the generic POSIX shell or (ii) the GNU bash shell?





    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/task/?15706>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/




reply via email to

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