|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Question about declaring local variables in a bash script
Hi guys,
In a bash script, are variables that are declared local able to be declared with the same name in two different functions? For example, Code:
f ()
{
local v=foo
h
}
g ()
{
local v=bar
h
}
h ()
{
echo $v
}
f #will this say foo?
g #will this say bar?
Thanks. |
|
#2
|
|||
|
|||
|
Why don't you try it and see what happens?
|
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Question about declaring local variables in a bash script |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|