Quote:
Originally Posted by HunterColt22
This is where I am stuck since I am unsure of how the else statement should look since I am not sure if I should say; "else ++1" Or something along those lines. Help would be appreciated again. thanks in advance.
|
1) To add element to array just use an index bigger than any indexes used before.
2) "i++" in bash looks like
Maybe there are nicer-looking way to do this, but it works and works faster than using "expr", etc.
There were loops in the script i've provided link to. Example:
Code:
while [ "${PAID[$i]}" != "" ]
do
#...
i=$(($i+1))
done
This is standart "while" loop, but in this example empty string marks an end of array (so I could add new entries easily), and array size isn't explicitly specified.
Did that answer you question?