I am having a C program which requires to read from stdin. This is one of the requirements, and it cannot change.
I have written a simple bash script that creates all the directories I want, handles the output etc. and also compiles and runs my program.
When I run my program it waits for the user to give an input from the stdin :
I want to be able to give that input from the bash - so do not let the user give the input (there is a reason for that). So ideally, I want somehow the input to be visible to the user but given from the script.
If I write something like this :
./task2 cat <<< "my input here"
It runs the task, and the cat command runs when the task has finished. I want somehow to enforce that cat whenever the program requires input from the user.
Is it possible?
./task2 <<< "my input here"
?