I wrote a program that mimics a command bashin Linux, in C. It works great with keyboard inputs , which means:
application > file: redirect application stdout to file (write output to file)application < file: redirect application stdin from file (read input from file)application >> file: redirect application stdout to file (add output to file)app1 | app2: redirect stdout from app1 to application stdin2app &: means the application should run in the background
All this works when I enter a command from the keyboard, as mentioned above.
To complete my task, I need to add another element, which is a redirect from the file. Meaning, if my program is called bashSimulator, then if I do this:
bashSimulator < fileWithCommands
fileWithCommands .
, .