470,833 Members | 1,350 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,833 developers. It's quick & easy.

system() function usage

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
2 2269
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
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.

Similar topics

41 posts views Thread by Alexei A. Frounze | last post: by
2 posts views Thread by Richard | last post: by
4 posts views Thread by Hermann Maier | last post: by
2 posts views Thread by miguel | last post: by
41 posts views Thread by Baron Samedi | last post: by
2 posts views Thread by Anish Chapagain | last post: by
30 posts views Thread by Yorian | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.