I have a bunch of files with digits in their names. Each file number belongs to a "group" or range of numbers. I'd like to match the file number within the group it is in and then export that as a variable. I'm not sure how to do this, but I assume it would be something similar to:
Array:
(A, 1, 20)
(B, 21, 34)
(C, 35, 52)
(D, 53, 68)
Where the first column is the group name, the second column is the first digit in the range and the last column is the last digit in the range. Then, I could apply something like:
if [ $num -ge "COLUMN2" ] && [ $num -le "COLUMN3" ]; then
groupname=COLUMN1
fi
I'm new to coding and just began learning the bash shell, so I would really prefer if you only gave me ways to this in bash. Also, I know that the second column seems unnecessary when you could just do while [ $num -ge "COLUMN3" ], but I need the first column later in the script.