[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] How to make the variables declared in a function local b
From: |
Greg Wooledge |
Subject: |
Re: [Help-bash] How to make the variables declared in a function local by default? |
Date: |
Thu, 21 Apr 2016 09:57:24 -0400 |
User-agent: |
Mutt/1.4.2.3i |
On Thu, Apr 21, 2016 at 08:53:39AM -0500, Peng Yu wrote:
> Hi, Sometime, it might be convenient to make the variables declared in
> a function local by default. Is it possible?
Every variable that is actually declared inside a function is local,
because the 'declare' command is synonymous with 'local'. (Unless you
use the '-g' option.)
Variables that are instantiated by assignment, without being explicltly
declared, are NOT local.