View Full Version : redirecting confusion

03-02-2010, 07:50 PM
Okay so I'm not really sure what I'm looking for but I can't find an example to figure it out.

So if I had a directory with a bunch of files could be text files. the directory is text.
and on linux I want to make a program that reads all the files in the directory so I want to use the redirect command on linux

myprog < text

what does my program to have to read the files in the directory "text"?
like is there an example because all the redirect commands all have examples redirecting files but I want to redirect a directory.

03-02-2010, 08:44 PM
for x in text/*; do cat $x >> somefile.txt; done

somefile.txt will contain everything in text.