How do you get command-line arguments in linux?

Linux specific forum
JustinJack
User
User
Posts: 89
Joined: Thu Feb 04, 2010 7:34 am
Location: Decatur, TX
Contact:

How do you get command-line arguments in linux?

Post by JustinJack »

Hello, you guys are going to be hearing a lot from me! I just installed Fedora 16 to dual boot on my win 7 box and am trying to get familiar with the linux API. I wish they has a nice pretty MSDN...Welp, I would greatly appreciate it if someone could show me how to do this:

Code: Select all

szCommandLine.s = Peeks(GetCommandLine_())
for the linux version of PB. It's easy enough in C, but alas. I like PB. That's a cool wish-list item, maybe a main() function in PB that if it's there, it will receive arguments... something like:

Procedure.i Main( argc.i, List argv.s() )

or something...
Little John
Addict
Addict
Posts: 4791
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: How do you get command-line arguments in linux?

Post by Little John »

JustinJack
User
User
Posts: 89
Joined: Thu Feb 04, 2010 7:34 am
Location: Decatur, TX
Contact:

Re: How do you get command-line arguments in linux?

Post by JustinJack »

Your are such a spicy jalapeno.
Little John
Addict
Addict
Posts: 4791
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: How do you get command-line arguments in linux?

Post by Little John »

JustinJack wrote:Your are such a spicy jalapeno.
What is your problem?
JustinJack
User
User
Posts: 89
Joined: Thu Feb 04, 2010 7:34 am
Location: Decatur, TX
Contact:

Re: How do you get command-line arguments in linux?

Post by JustinJack »

My problem? Probably that you need to take ESL...(eyes rolling...) But thanks for the help, mein kompf.
jassing
Addict
Addict
Posts: 1885
Joined: Wed Feb 17, 2010 12:00 am

Re: How do you get command-line arguments in linux?

Post by jassing »

JustinJack wrote:My problem? Probably that you need to take ESL...(eyes rolling...) But thanks for the help, mein kompf.
in the context, that's pretty hate-filled -- you asked a question, he pointed you tot he documentation; you responded with a very odd response that was not in any kind of programming or 'thanks for your help' type of context...
User avatar
idle
Always Here
Always Here
Posts: 5915
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: How do you get command-line arguments in linux?

Post by idle »

JustinJack, don't be surprised if no one bothers to offer any help in the future, with replies like that you don't deserve any.
Windows 11, Manjaro, Raspberry Pi OS
Image
Little John
Addict
Addict
Posts: 4791
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: How do you get command-line arguments in linux?

Post by Little John »

Now that's remarkable:
You try to help someone, and in appreciation of it you get an odd response.
Then after more than 1 year, there is another post with a dumb and hate-filled personal attack.

Jassing and idle, thanks for your comments.
idle wrote:JustinJack, don't be surprised if no one bothers to offer any help in the future, with replies like that you don't deserve any.
Agreed.
Well, he obviously needs a sort of help that this forum can not offer anyway ...
User avatar
luis
Addict
Addict
Posts: 3895
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: How do you get command-line arguments in linux?

Post by luis »

idle wrote:JustinJack, don't be surprised if no one bothers to offer any help in the future, with replies like that you don't deserve any.
Reality check: I would be surprised.
There is always someone willing to help, no matter what. Some people don't remember, others don't care about it.
You can joyfully be an ass with no particular consequences.
"Have you tried turning it off and on again ?"
User avatar
Kuron
Addict
Addict
Posts: 1626
Joined: Sat Oct 17, 2009 10:51 pm
Location: Pacific Northwest

Re: How do you get command-line arguments in linux?

Post by Kuron »

Little John wrote: Then after more than 1 year, there is another post with a dumb and hate-filled personal attack.

Just know his comments do not reflect the opinions of others you help. :wink:
Best wishes to the PB community. Thank you for the memories. ♥️
JustinJack
User
User
Posts: 89
Joined: Thu Feb 04, 2010 7:34 am
Location: Decatur, TX
Contact:

Re: How do you get command-line arguments in linux?

Post by JustinJack »

Oh my goodness. You guys really crack me up. Seriously. In Texas jalepenos are popular. A spicy jalapeno is the best kind. So if a Texan calls you a "spicy jalapeno" that's a compliment. If you respond to a compliment, (heck anything) with "What's your problem?", no matter where you're from, that carries an implied insult. So, ask a stupid question....get a stupid answer... If you don't understand, you could ask..."What do you mean by that?" Which carries no insult. Now, if in Germany, calling someone a "Spicy Jalapeno" is an old, traditional folk way of telling someone to **** off, then I'm wrong..and I apologize, Little John, I didn't mean that. But if not, e-mail me your address and I'll send you a box of tissues for the tears.
JustinJack
User
User
Posts: 89
Joined: Thu Feb 04, 2010 7:34 am
Location: Decatur, TX
Contact:

Re: How do you get command-line arguments in linux?

Post by JustinJack »

And, by-the-way...the after-a-year deal. (shrug)...I just found it. But I know a *heck* of a lot more now than I did then...so I will peruse some threads and see if I can answer anyone's questions without asking them what their problem is...I dunno...I'll try!
User avatar
luis
Addict
Addict
Posts: 3895
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: How do you get command-line arguments in linux?

Post by luis »

JustinJack wrote:You guys really crack me up.
Just count me out because I was replying to idle's remark in general (and I stand by it), not to your post in particular simply because I didn't know what being a spicy whatever means, and so I didn't have an opinion about that.

Anyway when replying you should consider there is a high degree of probability you are not talking to someone who lives in the same city block of yours, this is if you like to be understood. "what's your problem" should have been "what you are talking about/what do you mean" but nevertheless it should have given you the hint it was better to rephrase your original sentence.

On the other hand even when asking for clarifications, you don't always get an answer, so even that it's not foolproof.

Final lesson: A little more of ingenuity from both fronts could have saved the day (or the years in this case).
"Have you tried turning it off and on again ?"
JustinJack
User
User
Posts: 89
Joined: Thu Feb 04, 2010 7:34 am
Location: Decatur, TX
Contact:

Re: How do you get command-line arguments in linux?

Post by JustinJack »

Si, Signore. I suspect you may be correct. Maybe we should all speak (learn?) esperanto. Ha. Anyway. What I meant was "Thank you". Have a good weekend, Luis. This has been too much social media for me, since I don't even have a facebook account. I guess I'll check this thread around this time next year!
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Re: How do you get command-line arguments in linux?

Post by MachineCode »

JustinJack wrote:thanks for the help, mein kompf.
Calling a German person Hitler (by referring to them as "mein kompf") is extremely insulting, even for I as a bystander. Perhaps that is why Little John got angry? I can only assume so.
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
Locked