Cでやりたいの?
bashのsourceにlibglobってのがあるからそれ使って。

shell scriptでやるのが簡単だとおもうけれど。
"/bin/ls home/guest/*.txt"をpopen(2)するとか。