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: "Justin C. Walker" <email@hidden>
- Date: Sat, 06 Sep 2008 13:55:02 -0700
On Sep 2, 2008, at 20:20 , Michael wrote:
Firstly, i had an "&" in the pathway and I **think** this messed
things up.
Yup. If you read the man page for the shell you are using (by
default, it will be 'bash'), it will tell you about special characters
that are interpreted by the shell. The '&' causes the text preceding
it to be treated as the name of a command (plus possibly arguments to
the command); and it causes that command to be executed (if found) as
a background program (this is also explained in the shell man page).
For example,
$ /path/to&/command 10
would cause the shell to assume that "/path/to" was a command, and try
to execute 'to' in the directory '/path'. It would also try to
execute "/command 10":
$ /path/to&/command 10
[1] 9232
-bash: /path/to: No such file or directory
-bash: /command: No such file or directory
[1]- Exit 127 /path/to
Secondly, I learnt...and I am not sure why this is, one needs to
call "upper" then hit return, then provide the arguments to the
function "upper". After this, it worked as expected.
This is also correct; which part are you not sure about? The shell is
sitting there waiting for your commands. In simplistic terms, it
doesn't know what you want it to do until you type the "RETURN";
that's your signal to the shell that the line of text you have typed
is ready for it to act on.
FWIW, terminology typically used is:
"upper" is a command or program
"arguments" are provided on the command line (as in
"gcc foo.c -lm' ['foo.c' and '-lm' are two arguments
to 'gcc'])
The stuff you type when your program is running is "input" or "data".
These aren't laws of course :-}, and the only penalty for ignoring
them is that you will sometimes find that pedants pounce ...
HTH
Justin
--
Justin C. Walker, Curmudgeon-At-Large
Director
Institute for the Enhancement of the Director's Income
--------
"Weaseling out of things is what separates us from the animals.
Well, except the weasel."
- Homer J Simpson
--------
_______________________________________________
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