Hi, I want to be able to write a simple program that takes in input from the command line. I;m am at the level of getchar and putchar. Any examples would be a great help thanks.
I intend/prefer also to use the pipe command | eg: input | file1
---------- Post updated at 04:08 PM ---------- Previous update was at 04:01 PM ----------
For what its worth, check out the readline library. It is somewhat more work than getc/putc, but in many many cases its very much worth the effort: you get command line editing, command line history, key bindings, etc etc, and the API is not that difficult to use:
char line[MAX_LINE_LEN];
line = readline ("prompt > ");
/* If the line has any text in it, save it on the history. */
if (line && *line)
add_history (line);