split a string into array in bash return wrong size
Hi,
I'm trying to split a string, to later iterate using a for loop like Code:
for (( i=0; i<5; i++)) Here's the script: Code:
aver=$(grep "avg" A.txt | awk '{ print $2 }'); |
Can you make the file A.txt or a file with the same syntax available to us?
It is hard to find out where things goes wrong without knowing how the file looks like. If you link to a copy of the actual file remember to remove any sensitive information. |
Same problem as here. You missed the parentheses for array assignment:
Code:
a=( $(echo $aver | tr " " "\n") ) |
All times are GMT -5. The time now is 06:11 PM. |