What I'd like to do is for each set of numbers in the second file indicate if the first or second number (or both) in the first file falls between or is equal to those numbers in the second file.
e.g. print our:
X 1 10: A_first A_second B_first C_first C_second
Y 3 5: B_first C_second
Z 5 9: A_second C_first
My general idea was to open 3 arrays from the 1st file and use an 'if' comparison to the values in the second file but I really don't know what I'm doing.
Output should be something to indicate the string in File 1 and which number(s) first second or both in the line with that string have hit appended to the end of the line in File 2
e.g.
X 1 10: A_2 A_7 B_3 C_5 C_10
Y 3 5: B_3 C_5
Z 5 9: A_7 C_5
Somehow this just sounds like you would end up with a different and easier problem if you thought about it a little bit. What is it that you are trying to accomplish, on a higher level of abstraction?
Not the most efficient as it makes as many passes through File1 as there are lines in File2 but give it a shot for grins.
while read x y z
do
S=$x" "$y" "$z":"
while read a b c
do
if [ $b -ge $y -a $b -le $z ]; then
S=$S" "$a"_"$b
fi
if [ $c -ge $y -a $c -le $z ]; then
S=$S" "$a"_"$c
fi
done < File1
echo $S
done < File2