Re: [SLE] Compiled a C program, cannot run by name



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



Relevant Pages

  • Re: [SLE] Compiled a C program, cannot run by name
    ... Your current directory is not checked for executables in most ... > not delivered to the list because Simon Roberts's reply had a reply-to header ... And why should the DOS shell be derided for providing this ... I did a man exec and it seems to be a bash script executor, ...
    (SuSE)
  • Re: What is the name of the 4DOS language?
    ... While technically true, the platforms known as PC-DOS, MS-DOS, DR-DOS, ... PTS-DOS, etc. actually contain the token "DOS" in their formal product ... As UNIVAC's ECL is (Executive Control Language), ... Most of the shell scripts I've seen start with #/bin/sh, ...
    (comp.os.msdos.4dos)
  • Re: Shell to Command
    ... > I have a VB6 program that shells to the dos prompt then opens an ftp ... > manually start a dos session and type in the command line ftp, ... Am I missing something in the shell function? ...
    (microsoft.public.vb.syntax)
  • Re: Environmental Variables
    ... BUT it is shell. ... >>NT does not have an underlying DOS - that is, it does not run as a DOS ... > complete and unlike real DOS, the 'DOS' window is in fact a Windows ... Windows 3.x runs on top of DOS so any shell has the DOS API available. ...
    (comp.os.msdos.programmer)
  • Re: DOS Befehle
    ... sie explizit als "Meine Frage bezieht nicht auf DOS, ... auf die Shell eines NT-Derivats" gekennzeichnet sein sollten. ... Eine Shell dagegen hat nichts mit dem Betriebssystem zu tun. ... ein ganz normales Benutzerprogramm das ein Interface zwischen dem ...
    (de.comp.os.msdos)