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


Groups > gnu.bash.bug > #15856

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 12:02:31 -0500 (EST)
Lines 21
Approved bug-bash@gnu.org
Message-ID <mailman.115.1580403769.2384.bug-bash@gnu.org> (permalink)
References <20200129142305.GX1350@eeg.ccf.org> <20200128210225.GC12574@localhost4.local> <20806.1580277461@jinx.noi.kre.to> <19032.1580321011@jinx.noi.kre.to> <20200129190553.GC5533@localhost4.local> <b9e672cf-9d32-b066-409d-882032cd79ae@case.edu> <alpine.DEB.2.21.2001301157560.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 1580403769 27254 209.51.188.17 (30 Jan 2020 17:02:49 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=1580404665; h=Feedback-ID: X-Smtpcorp-Track:Message-ID:Subject:To:From:Date:Reply-To:Sender: List-Unsubscribe; bh=UU/5QPTt19g/D6PiVyFY4d42gPfZAx63A2xH+0BjLKc=; b=TXOW8H3r +BKk3iT6WozIcrI03PwPCTmlpXQMDp8VyBIqTuvLWJXfxB6sPoDqQL8Gdku/bbGEszxnq/dAjhbLG ZJdmVUsGFuVP0AkZvLHQQB/Z5GI9HS3grlWoRpVWO5cXfPDf6hc2SRgkaHlaWJdukrv5qnK3YkyuX GsNgdNVJygExxkmKPsxcc0tGXtBdv4iURXs3aTp1duzoxz2W37zRLRrnh92UlKx/0BPNaE4sny0gQ 4EmQFOCTbqxeHjdEfW6TDu86BNuFEo1MzAQTwwqBQKXpW7CYQR4+KbHAUZRgHi6tIvGv/lYwNEI7h DDti/S75WoLxNIN8WYQSCbapSw==;
X-X-Sender chris@chris
In-Reply-To <b9e672cf-9d32-b066-409d-882032cd79ae@case.edu>
User-Agent Alpine 2.21 (DEB 202 2017-01-01)
X-Smtpcorp-Track 1ixDD6095GcZE1.u0wpf8ecb
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.2001301157560.27533@chris>
X-Mailman-Original-References <20200129142305.GX1350@eeg.ccf.org> <20200128210225.GC12574@localhost4.local> <20806.1580277461@jinx.noi.kre.to> <19032.1580321011@jinx.noi.kre.to> <20200129190553.GC5533@localhost4.local> <b9e672cf-9d32-b066-409d-882032cd79ae@case.edu>
Xref csiph.com gnu.bash.bug:15856

Show key headers only | View raw


On Wed, 29 Jan 2020, Chet Ramey wrote:

> On 1/29/20 2:05 PM, Roger wrote:
>
>> "Linux Shell Scripting with Bash." (Burtch) suggested using declare instead of
>> local, due to local lacking the other switches declare provides. p262 (eg.
>> declare can specify type of variable, such as integar only.)
>
> This is just wrong. `local' accepts the same option set as `declare'.

There are other things wrong in that book as well; the description of
printf, for example.

Don't use it as an authority on bash.

-- 
    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 12:02 -0500

csiph-web