system() function usage

N

nnandini8

Hello Guys,
I have a doubt in system() function. I need to implement
the certain command line arguements in a program.
For Example

if I type "dnaml" at command line and press enter then it will ask me
to enter 'Y' and if I press enter it will generate some files.
So here I used

system("dnaml")

function and I am confused how to provide 'Y' without typing in
command line.
Any help will greatly be appreciated.

Thank You
Nandini
 
M

mlimber

Hello Guys,
I have a doubt in system() function. I need to implement
the certain command line arguements in a program.
For Example

if I type "dnaml" at command line and press enter then it will ask me
to enter 'Y' and if I press enter it will generate some files.
So here I used

system("dnaml")

function and I am confused how to provide 'Y' without typing in
command line.
Any help will greatly be appreciated.

Thank You
Nandini

The answer to your question is OS-specific, and so you should take the
question to a newsgroup for your OS. See this FAQ for some ideas of
where to post:

http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.9

<OT>It will probably look something like: system( "echo y | dnaml" )
unless there are some command line switches you can append to your
command line to produce the same behavior.</OT>

Cheers! --M
 
P

Phlip

So here I used

system("dnaml")

function  and I am confused how to provide 'Y' without typing in
command line.

None of the answers are on-topic for this newsgroup. They are: Either use a
variant of popen() that redirects a "y" in, or use system("dnaml <
yes.txt");

You will get the best answer by Googling for a forum that discusses either
your compiler's libraries or your command line syntax for your platform.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,286
Latest member
ChristieSo

Latest Threads

Top