By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,982 Members | 1,939 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,982 IT Pros & Developers. It's quick & easy.

system() function usage

P: n/a
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

Apr 20 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
nnandi...@gmail.com wrote:
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-lit...t.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

Apr 20 '06 #2

P: n/a
nn*******@gmail.com wrote:
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.

--
Phlip
http://www.greencheese.org/ZeekLand <-- NOT a blog!!!
Apr 20 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.