Reputation: 2120
I have a C program in which two scanf() are done.
I need to write a shellscript that will run the program and give it the arguments too.
The problem is that all I could come up with is how to pipeline an argument into the program as a command line arguments which is not what I need.
Any help appreciated.
Upvotes: 0
Views: 2498
Reputation: 29265
This should work
echo "some input" | yourprog
e.g. echo "1 1 + p" | dc
Upvotes: 1