Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Help /proggles/~

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.

Name: Anonymous 2012-08-03 3:09

>>2

What do the variables represent and where are they used? Would it be possible to name them all the same and replace all references to usage of a single variable? If they are never modified this will be possible. But if they are modified, it is a different story. I wouldn't worry about the redundancy if it is the second case.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List