Name: Anonymous 2012-08-03 2:06
I'm currently working on a bash script and I want to define multiple variables the same way. All of them are defined the same, so it seems inefficient to define each one individually. Is there a way to define an entire array all at once, rather than each individual variable?
This is an extreme oversimplification, but I want to do something like this:
array=( $a $b $c)
array=1
And then all the variables would have a value of 1.
Here's something like what I'm currently doing:
a=1
b=1
c=1
It seems like such an inefficient way to do it though. So what should I do?
Thanks in advance for any and all help.
This is an extreme oversimplification, but I want to do something like this:
array=( $a $b $c)
array=1
And then all the variables would have a value of 1.
Here's something like what I'm currently doing:
a=1
b=1
c=1
It seems like such an inefficient way to do it though. So what should I do?
Thanks in advance for any and all help.