libbash
|
Welcome to libbash FAQ page!
This page contains list of most known problems you may run into while developing a bash libarary.
How can I use a local
variable as an array
?
When using a local
variable, the line:
local VAR_NAME
is used as a declaration of VAR_NAME. Unless implicitly mentioned otherwise, declaire
creates a `regular' variable. Because of that, in order to use a local array you must implicitly declaire that it is an array:
declaire -a local ARR_NAME
Using hashstash (3) hashes, How do I declare a local
hash
?
You can't. The reason for that is that every hash
created by hashstash
is created as a hashstash internal variable. I.e. the actual name of the hash is not HASHNAME
but __hashstash_HASHNAME
.