Find all sample*_1.txt files/directories under current directory and print 'program  sample*-out sample*_1.txt sample*_2.txt' for each of them
find . -name "sample*_1.txt" | sed -n 's/_1\..*$//;h;s/$/_out/p;g;s/$/_1.txt/p;g;s/$/_2.txt/p' | xargs -L 3 echo program