Unix Programming - Invoking a program: exec() and command line

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > February 2006 > Invoking a program: exec() and command line





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

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.

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com