Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #262599

Shell-script variable name case [WAS: Re: can you parse and "tail" at once? (and if you can't why not?)]

From David <bouncingcats@gmail.com>
Newsgroups linux.debian.user
Subject Shell-script variable name case [WAS: Re: can you parse and "tail" at once? (and if you can't why not?)]
Date 2023-10-23 16:00 +0200
Message-ID <Hs3Dj-hUG-3@gated-at.bofh.it> (permalink)
References (4 earlier) <HrO1z-8aO-1@gated-at.bofh.it> <HrP7j-8Oc-1@gated-at.bofh.it> <HrS5b-azX-1@gated-at.bofh.it> <HrSHT-b8Q-1@gated-at.bofh.it> <Hs3Dj-hUG-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, 23 Oct 2023 at 13:25, Eduardo M KALINOWSKI
<eduardo@kalinowski.com.br> wrote:
> On 22/10/2023 23:13, Greg Wooledge wrote:

> > 2) All-caps variable name IFL.  All-caps variable names are reserved,
> >    by convention, for environment variables (e.g. PATH) and special
> >    shell variables (e.g. IFS).

> While I don't disagree with the suggestion of using lower case for
> variables (and have even started doing so myself), it seems that this
> "convention" is far from universal.

> I did a quick search on the bash manual page and found no suggestion on
> how to name user variables, or that uppercase names are reserved (but it
> was a very quick search - I might have skipped something).

> Even an internet search shows that people seem to be divided:

Hi, for your info, this convention is specified by POSIX:
  https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html

Which says:
  Environment variable names used by the utilities in the Shell and
  Utilities volume of POSIX.1-2017 consist solely of uppercase letters,
  digits, and the <underscore> ( '_' ) from the characters defined in
  Portable Character Set and do not begin with a digit.

And:
  The name space of environment variable names containing lowercase letters
  is reserved for applications. Applications can define any environment
  variables with names from this name space without modifying the behavior
  of the standard utilities.

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

can you parse and "tail" at once? (and if you can't why not?) Albretch Mueller <lbrtchx@gmail.com> - 2023-10-22 18:40 +0200
  Re: can you parse and "tail" at once? (and if you can't why not?) Charles Curley <charlescurley@charlescurley.com> - 2023-10-22 19:10 +0200
    Re: can you parse and "tail" at once? (and if you can't why not?) Greg Wooledge <greg@wooledge.org> - 2023-10-22 19:50 +0200
      Re: can you parse and "tail" at once? (and if you can't why not?) Albretch Mueller <lbrtchx@gmail.com> - 2023-10-22 23:00 +0200
        Re: can you parse and "tail" at once? (and if you can't why not?) Andy Smith <andy@strugglers.net> - 2023-10-22 23:20 +0200
          Re: can you parse and "tail" at once? (and if you can't why not?) gene heskett <gheskett@shentel.net> - 2023-10-23 00:30 +0200
            Re: can you parse and "tail" at once? (and if you can't why not?) Albretch Mueller <lbrtchx@gmail.com> - 2023-10-23 03:40 +0200
              Re: can you parse and "tail" at once? (and if you can't why not?) Greg Wooledge <greg@wooledge.org> - 2023-10-23 04:20 +0200
                Re: can you parse and "tail" at once? (and if you can't why not?) <tomas@tuxteam.de> - 2023-10-23 06:50 +0200
                Shell-script variable name case [WAS: Re: can you parse and "tail" at  once? (and if you can't why not?)] David <bouncingcats@gmail.com> - 2023-10-23 16:00 +0200
              Re: can you parse and "tail" at once? (and if you can't why not?) Andy Smith <andy@strugglers.net> - 2023-10-23 22:10 +0200
        Re: can you parse and "tail" at once? (and if you can't why not?) Patrick Wiseman <pwiseman@gmail.com> - 2023-10-23 04:50 +0200
  Re: can you parse and "tail" at once? (and if you can't why not?) Roberto C. Sánchez <roberto@debian.org> - 2023-10-22 19:50 +0200
  Re: can you parse and "tail" at once? (and if you can't why not?) Andy Smith <andy@strugglers.net> - 2023-10-22 20:00 +0200
  Re: can you parse and "tail" at once? (and if you can't why not?) Pankaj Jangid <pankaj@codeisgreat.org> - 2023-10-23 10:00 +0200
    Re: can you parse and "tail" at once? (and if you can't why not?) Greg Wooledge <greg@wooledge.org> - 2023-10-23 14:20 +0200
      Re: can you parse and "tail" at once? (and if you can't why not?) Albretch Mueller <lbrtchx@gmail.com> - 2023-10-24 00:20 +0200

csiph-web