I have a scenario as follows:
testing1=acs
testing2=rcs
testing3=mes
testing4=gcp
i need to print the values: acs rcs mes gcp I am using following for loop:
TotalOutputString=''
for current_number in {1..${max_number}}
do
TotalOutputString="${TotalOutputString} ${testing$current_number} "
done
echo $TotalOutputString
But this is not giving proper output. Its only printing numbers.
bash. (You also aren't iterating over the numbers 1 through 4 if you are usingbash, but rather iterating once withcurrent_numberset to the literal string{1..4}.)