|
From: | Chris F.A. Johnson |
Subject: | Re: Preventing Bash Variable Confusion |
Date: | Thu, 30 Jan 2020 12:02:31 -0500 (EST) |
User-agent: | Alpine 2.21 (DEB 202 2017-01-01) |
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)
[Prev in Thread] | Current Thread | [Next in Thread] |