I have one queston about nested loop with bash.
I have an input files with one file name per line (full path) I read this file and then i make a nest loop:
for i in $filelines ; do
echo $i
for j in $filelines ; do
./program $i $j
done
done
The program I within the loop is pretty low. Basically it compare the file A with the file B.
I want to skip A vs A comparison (i.e comparing one file with itslef) AND I want to avoid permutation (i.e. for file A and B, only perform A against B and not B against A).
What is the simplest to perform this?
Version 2: this one takes care of permutations
What is done here:
a b
andb a
will be same in the unsorted file.sort | uniq
on $tmpunsorted, so the result is a list of individual argument pairs.