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" 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: 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> 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: 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 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: 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> Xref: csiph.com gnu.bash.bug:15856 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 =========================== Author: =============================== Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress) Pro Bash Programming: Scripting the GNU/Linux shell (2009, Apress)