LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 10-21-2004, 04:38 PM   #1
hippo159
LQ Newbie
 
Registered: Sep 2004
Posts: 8

Rep: Reputation: 0
send args tom main metod


Hi
I want to send arguments to my main method what should i write?
Something like this ./prig [argument]
 
Old 10-21-2004, 04:53 PM   #2
CroMagnon
Member
 
Registered: Sep 2004
Location: New Zealand
Distribution: Debian
Posts: 900

Rep: Reputation: 33
I don't quite understand your question. Are you trying to write a script or something?

If you are using C, you write your main method line like this:
int main( int argc, char *argv )
and then argv is an array of the strings you put on the command line.

If you are using a shell script, the parameters are usually called $1, $2, $3, etc.
 
  


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
LQ Radio Interview #1 - Tom Adelstein and Sam Hiser jeremy LQ Suggestions & Feedback 20 06-17-2005 06:20 AM
command line args in a countdown Squeak2704 Programming 1 04-26-2004 12:27 PM
Specific Tom Waits Picture dushkinup General 1 04-03-2004 08:46 PM
free()'n args zer0python Programming 2 10-27-2003 05:07 PM
>>> control mplayer with command args??? nibjb Linux - Software 0 07-16-2003 11:09 PM


All times are GMT -5. The time now is 01:05 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