[cs631apue] Read piped files using getopt or argv?

Tejas Nadkarni tnadkarn at stevens.edu
Sat Dec 7 00:26:46 EST 2013


Nevermind, figured out. I forgot < redirects to stdin so just had to use
scanf if no more command line arguments.


On Fri, Dec 6, 2013 at 11:09 PM, Tejas Nadkarni <tnadkarn at stevens.edu>wrote:

> I'm trying to figure out how to read in the piped files with getopt/argv.
>
> i.e. ./aed -e -p secret <input
>
> How do I read in the input? I tried using argv[optind] or even argv[argc]
> and I get null.
>
> Any tips on how to read this in? It works fine if you enter text at the
> command line but I can't get the piped files to work. Output seems to work,
> just need help with the input.
>
> Thanks for help
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.stevens.edu/pipermail/cs631apue/attachments/20131207/dc78a90d/attachment.html>


More information about the cs631apue mailing list