Hi,
I have the following folder structure:
TST500-1000
TST500-2000
TST500-3000
TST700-1000
TST700-2000
TST700-3000
TST900-1000
TST900-2000
TST900-3000
I would like to store the numbers in the first column (considering "-" as column separator) into a variable then the numbers in the 2nd column into another variable.
When I run :
for i in $(ls -1 -d TST* | awk '{print substr($0,4,3)}') ; do for j in $(ls -1 -d TST$i* | awk -F- ' {print $2}'); do echo $i $j ; done ; done
it duplicate all values:
500 1000
500 2000
500 3000
500 1000
500 2000
500 3000
500 1000
500 2000
500 3000
700 1000
700 2000
700 3000
700 1000
700 2000
700 3000
700 1000
700 2000
700 3000
900 1000
900 2000
900 3000
900 1000
900 2000
900 3000
900 1000
900 2000
900 3000
Would be possible to adjust the command to get the same number of values as folders:
500 1000
500 2000
500 3000
700 1000
700 2000
700 3000
900 1000
900 2000
900 3000
Thanks in advance,
Alex