How is explained about the `local` is valid variable

Can we validly write a line
 
unset local a b c d e f g h i

to mean:
local a b c d e f g h i;unset a b c d e f g h i
if yes, how come local=9 is valid variable 'local' normally ? thanks much
Last edited on
I think we are having trouble understanding your translation. Do you have someone who might help with the English and knows some C++?

By default a variable is local, it has a local scope.
You can make them global, or you can use the heap to make them dynamic.
Last edited on
From the OP's other recent posts, it looks like a bash question, not a C++ question.
https://ss64.com/bash/local.html
> Can we validly write a line [...]

yes, that line is valid, but it doesn't do what you think it does. It will unset a variable named local. It won't have any special effect on variables in local scope

> local a b c d e f g h i;unset a b c d e f g h i

no, it will not mean this, because unset will already unset variables in local scope first. So, it doesn't do any good to ask it to.

> if yes, how come local=9 is valid variable 'local' normally ?

because variable names aren't treated the same as commands in bash.
Topic archived. No new replies allowed.