Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


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

Rep: Reputation: 15
passing arguments to system command


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
Old 12-17-2009, 04:46 AM   #2
Registered: Oct 2009
Posts: 467

Rep: Reputation: 139Reputation: 139
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.


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 10:27 AM
EXPECT/TCL: the "source" command and passing arguments qmqmqm Programming 4 04-02-2009 06:36 PM
Passing command line arguments through getopts and long options neville310 Programming 3 04-16-2007 07:38 AM
Passing a text file to the command line as arguments wimnat Linux - General 2 12-05-2005 09:09 AM
passing a list of arguments to a command hdagelic Linux - General 2 05-09-2005 10:30 AM

All times are GMT -5. The time now is 08:55 AM.

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