Re: help with calling a standard line app from terminal
Re: help with calling a standard line app from terminal
- Subject: Re: help with calling a standard line app from terminal
- From: "Clark Cox" <email@hidden>
- Date: Tue, 2 Sep 2008 19:48:03 -0700
On Tue, Sep 2, 2008 at 5:31 PM, Michael <email@hidden> wrote:
> Hi all,
> I am working my way through K&R, getting ever closer to obj C, and in
> section 7, wrote a small app , in the standard tool called "upper".
>
> So, 2 questions please.
>
> 1) What is passed to argv[0]? is it just "upper" or the full path to the
> app, and if so, how does one determine this?
It is whatever was used to launch your program. If the user launched
it with the full path, then you will get the full path, if the user
launched it with a relative path, you will get that. another program
could pass anything that they want when launching your program (even a
string that is totally unrelated to your application)
What do you need to know this for?
> 2) How to call this app from the terminal...I am guessing the full path,
> but nothing I have tried has worked so far.
If you put your program in a directory that is in your $PATH
environment variable, you can launch it with just a name. Otherwise,
you can use any kind of path (full, relative) as long as it refers to
your program's location in the filesystem.
--
Clark S. Cox III
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden