| Author |
Invoking a program: exec() and command line
|
|
| D'artagnan 2006-02-14, 9:06 pm |
| How can a program know, at run time, whether it was invoked by a
command line or by an exec? Thanks.
| |
| Gordon Burditt 2006-02-14, 9:06 pm |
| >How can a program know, at run time, whether it was invoked by a
>command line or by an exec? Thanks.
It was invoked by an exec.
It might have been invoked by an exec from a command-line interpreter
that used a command-line to construct the arguments to the exec.
Or maybe not.
Gordon L. Burditt
| |
| David Schwartz 2006-02-15, 3:03 am |
|
"D'artagnan" <musketeers@gmail.com> wrote in message
news:1139962479.032779.252370@f14g2000cwb.googlegroups.com...
> How can a program know, at run time, whether it was invoked by a
> command line or by an exec? Thanks.
What do you think the shell does when a person enters a command line?
It would help if you gave a lot more details -- why do you think you
need to know this?
DS
| |
| D'artagnan 2006-02-15, 3:03 am |
| Understood. Thanks. The shell actually forks and runs the program using
exec.
|
|
|
|