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


Groups > gnu.bash.bug > #15858

Re: Preventing Bash Variable Confusion

Path csiph.com!3.us.feeder.erje.net!feeder.erje.net!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail
From "Chris F.A. Johnson" <chris@cfajohnson.com>
Newsgroups gnu.bash.bug
Subject Re: Preventing Bash Variable Confusion
Date Thu, 30 Jan 2020 21:13:45 -0500 (EST)
Lines 18
Approved bug-bash@gnu.org
Message-ID <mailman.1.1580436833.2412.bug-bash@gnu.org> (permalink)
References <20200128210225.GC12574@localhost4.local> <CAJnmqwbr6EVJOZn6SLdByAgZAoFN60ahCp3m2HJyJ6VS=hwEvg@mail.gmail.com> <20200130064018.GA23692@localhost4.local> <CAJnmqwa0y4iOQEzFPZjGGqtJ3eLPPdsZRz2ZAfLneEtQUJo2nA@mail.gmail.com> <20200130194153.GB7255@localhost4.local> <alpine.DEB.2.21.2001302111240.27533@chris>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain; charset=US-ASCII; format=flowed
X-Trace usenet.stanford.edu 1580436833 10923 209.51.188.17 (31 Jan 2020 02:13:53 GMT)
X-Complaints-To action@cs.stanford.edu
To bug-bash@gnu.org
Envelope-to bug-bash@gnu.org
DKIM-Signature v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=smtpservice.net; s=m2o5g0.a1-4.dyn; x=1580437729; h=Feedback-ID: X-Smtpcorp-Track:Message-ID:Subject:To:From:Date:Reply-To:Sender: List-Unsubscribe; bh=m7DEVkLry504iBMTCdI50gv9LeYKnsG48K+NKhP0jOs=; b=1Cu5a7F4 GvmNa3MD9yfzCSHfzjd90N9u9fR3iDrkoRwKe8cv74PsJqygo9SrwogBk19qeau/GrZeLJZEZNICC ohXyTzEyQmOAAe26I6mn43kcfhkjRgDXAAKXc/RC+zKyOWgYnhJPryk6KyYy3WYPpqmk1/e/emP03 pS8PZAJeADY9wVtwkfXMbhYQBZkmKzc2EYg2qO4+0I13lTI3SNA96Wm5JcBj3RgbHszTKb85ju6ds KeejGIkNW4cUxfGTHhKKwyIPsm4iIRw1upCtDROZiXuyRqgAvP0lSfTfL9Ywn3Pc5stWq2Xwwus4f 5cGkrpnWy70dtdMJ3Zl0M5iYDA==;
X-X-Sender chris@chris
In-Reply-To <20200130194153.GB7255@localhost4.local>
User-Agent Alpine 2.21 (DEB 202 2017-01-01)
X-Smtpcorp-Track 1ixLoZ095HpQCG.u81aDOgy8
Feedback-ID 124612m:124612a-vpTX9:124612sMncmGVQT5
X-Report-Abuse Please forward a copy of this message, including all headers, to <abuse-report@smtp2go.com>
X-detected-operating-system by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From 103.47.205.39
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.23
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <https://lists.gnu.org/archive/html/bug-bash>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
X-Mailman-Original-Message-ID <alpine.DEB.2.21.2001302111240.27533@chris>
X-Mailman-Original-References <20200128210225.GC12574@localhost4.local> <CAJnmqwbr6EVJOZn6SLdByAgZAoFN60ahCp3m2HJyJ6VS=hwEvg@mail.gmail.com> <20200130064018.GA23692@localhost4.local> <CAJnmqwa0y4iOQEzFPZjGGqtJ3eLPPdsZRz2ZAfLneEtQUJo2nA@mail.gmail.com> <20200130194153.GB7255@localhost4.local>
Xref csiph.com gnu.bash.bug:15858

Show key headers only | View raw


On Thu, 30 Jan 2020, Roger wrote:

>> They still allow you to define constants in all-caps.  The impact it
>> makes is not so different with defining globals as such.  Try Ruby.
>
> The reason I used to prefer using all uppercase/capital letters, the variable
> definitations would stand out similar to C style definition macros.  Variables
> become extremely identifiable and comprehensible.

A text editor, such as emacs in Bash mode, can highlight variables. No
need to use any sort of naming convention.

-- 
    Chris F.A. Johnson                         <http://cfajohnson.com/>
    =========================== Author: ===============================
    Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
    Pro Bash Programming: Scripting the GNU/Linux shell (2009, Apress)

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: Preventing Bash Variable Confusion "Chris F.A. Johnson" <chris@cfajohnson.com> - 2020-01-30 21:13 -0500

csiph-web