in reply to redirecting input to console

From what I remember of getch, it takes input from a character buffer, defaulting to STDIN if that buffer is empty. Hence, redirecting something as input from a 'system' call should (hopefully) work:

system("cpp_program < $password");

Of course, I could be wrong about getch() and a character buffer ..

Hope this is of some help.
--Foxcub

Replies are listed 'Best First'.
Re: Re: redirecting input to console
by waswas-fng (Curate) on Aug 22, 2002 at 15:47 UTC
    I dont think so, If I remember right the passwd program uses getch on most flavors of unix and it will not take input passed though STDIN for the password prompts..

    -Waswas