I want to pass a file into a c program.
If I am doing it in the IDE this arguments
./test string string < test.txt
return arg
The <
symbol will insert information from somewhere (a text file) as if you typed it yourself. It's often used with commands that are designed to get information from standard input only.
For example (using tr):
tr '[A-Z]' '[a-z]' < fileName.txt > fileNameNew.txt
The example above would insert the contents of fileName.txt
into the input of tr
and output the results to fileNameNew.txt
.
Answer adapted from this page. For similar information about all symbols, use this page