How does a C program know its input is being redirected?

M. Pinghua Young mpyoung at portia.Stanford.EDU
Thu Aug 16 15:00:13 AEST 1990


I am writing a program that prompts users for various inputs.  However,
the user can also put the input in a file and pipe it to my program, or
use input redirection "<".  In this case I don't want the program to
prompt anything.  Can anyone tell me how to achieve that?  Please send
me e-mails.  Thank!

-- 
|   M. Pinghua Young               |    Confucius Said:                 |
|   pinghua at suwatson.bitnet        |        "Life Begins at 30"         |
|   mpyoung at portia.stanford.edu    |               But He Died At 29.   |



More information about the Comp.unix.questions mailing list