LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 12-17-2009, 12:23 AM   #1
nathan
LQ Newbie
 
Registered: Aug 2009
Location: california
Distribution: fedora
Posts: 21

Rep: Reputation: 15
passing arguments to system command


Hi,

I am calling another executable in my application (C programing) using "system" command
which is user interactive program.

now i want to pass those args in system command only.

system(" executable ");

Executable will expect 1,2 or 3.

1 is to continue
2 for do changes in settings
3 exit from application

how to pass these in to system command


Thanks in Advance
Nathan
 
Old 12-17-2009, 03:46 AM   #2
JohnGraham
Member
 
Registered: Oct 2009
Posts: 467

Rep: Reputation: 138Reputation: 138
No magic, just do as you would at the command-line - change the string "executable" to "executable 1" and "1" will get passed as the first argument.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing command-line arguments to qglviewer application MALDATA Programming 1 07-15-2009 09:27 AM
EXPECT/TCL: the "source" command and passing arguments qmqmqm Programming 4 04-02-2009 05:36 PM
Passing command line arguments through getopts and long options neville310 Programming 3 04-16-2007 06:38 AM
Passing a text file to the command line as arguments wimnat Linux - General 2 12-05-2005 08:09 AM
passing a list of arguments to a command hdagelic Linux - General 2 05-09-2005 09:30 AM


All times are GMT -5. The time now is 01:19 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration