ShadyBears
ShadyBears

Reputation: 4185

Redirection in Linux

Input files to test project 2. Intended to be used via redirection.

My professor gave us a txt file to use to test if our program works. It reads in ~1000 numbers (so we wouldn't have to manually enter them). But I don't know the linux command on how to use this txt file.

ccarri7@ubuntu:~/C$ ls
ccarri7lab2  ccarri7lab2.c  lab2input.txt
ccarri7@ubuntu:~/C$ 

This is the folder where my executable/source/txt file are.

Upvotes: 0

Views: 152

Answers (2)

a.m.
a.m.

Reputation: 2171

Did you try

ccarri7lab2 < lab2input.txt

Hope this is what you want, else you can give some more info.

Upvotes: 2

Kyle
Kyle

Reputation: 893

./ccarri7lab2 < lab2input.txt

will use the text in lab2input.txt as arguments for ccarri7lab2

http://linux.about.com/od/itl_guide/a/gdeitl42t01.htm

Upvotes: 3

Related Questions