Re: [SLE] Compiled a C program, cannot run by name
- From: Steve Graegert <graegerts@xxxxxxxxx>
- Date: Sun, 8 Jan 2006 13:05:31 +0100
On 1/8/06, Mike McMullin <mwmcmlln@xxxxxxxx> wrote:
> On Sun, 2006-01-08 at 13:14 +0530, Shriramana Sharma wrote:
> > Sunday, 08 January 2006 11:09 samaye, Tom Peters alekhiit:
> >
> > > Where is it? Your current directory is not checked for executables in most
> > > shells, unlike that toy o/s MS-DOS. If there isn't a PATH to it, you will
> > > definitely have to specify ./filename
> >
> > Thanks, all, for your interest. Apparently my previous post to the list was
> > not delivered to the list because Simon Roberts's reply had a reply-to header
> > to his id.
> >
> > I have since been able to successfully run many programs using ./filename, but
> > I do wonder why the current directory is not checked. What is wrong with that
> > behaviour? And why should the DOS shell be derided for providing this
> > facility?
>
> PWD may or may-not be in the path of the user. *nix checks the path
> first, DOS checks the path and the current directory. (I do mean
> checks, as DOS is still being used today, I've run 4 CNC machines that
> boot DOS, 2 MS-DOS and 2 DR-DOS).
>
> I did a man exec and it seems to be a bash script executor, IIRC you
> had compiled the program in the original question, what impact could
> exec have in this situation?
When calling "exec ./myapp" the process image of the shell is replaced
with the process image of myapp which is loaded from disk. When myapp
returns the shell process is not available anymore, since it has been
replaced with myapp. You will usually not use exec with interactive
shells.
\Steve
--
Steve Graegert <graegerts@xxxxxxxxx>
Software Consultant {C/C++ && Java && .NET}
Office: +49 9131 7123988
Mobile: +49 1520 9289212
--
Check the headers for your unsubscription address
For additional commands send e-mail to suse-linux-e-help@xxxxxxxx
Also check the archives at http://lists.suse.com
Please read the FAQs: suse-linux-e-faq@xxxxxxxx
- References:
- Re: [SLE] Compiled a C program, cannot run by name
- From: Mike McMullin
- RE: [SLE] Compiled a C program, cannot run by name
- From: Greg Wallace
- RE: [SLE] Compiled a C program, cannot run by name
- From: Tom Peters
- Re: [SLE] Compiled a C program, cannot run by name
- From: Shriramana Sharma
- Re: [SLE] Compiled a C program, cannot run by name
- From: Mike McMullin
- Re: [SLE] Compiled a C program, cannot run by name
- Prev by Date: Re: [SLE] Compiled a C program, cannot run by name
- Next by Date: Re: [SLE] problem with K3B
- Previous by thread: Re: [SLE] Compiled a C program, cannot run by name
- Next by thread: Re: [SLE] Compiled a C program, cannot run by name
- Index(es):
Relevant Pages
|