Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.misc > #1079

Re: Why these program need './'?

From Robert Riches <spamtrap42@jacob21819.net>
Newsgroups comp.os.linux.misc
Subject Re: Why these program need './'?
Date 2011-05-13 04:23 +0000
Organization none-at-all
Message-ID <slrnispci5.fe0.spamtrap42@one.localnet> (permalink)
References <9860fe23-204a-4c07-9d2e-e3479d096a3c@p13g2000yqh.googlegroups.com> <s3ku98-qom.ln1@206-248-139-163.dsl.teksavvy.com>

Show all headers | View raw


On 2011-05-13, Chris F.A. Johnson <cfajohnson@gmail.com> wrote:
> On 2011-05-13, fl wrote:
>> Hi,
>> I am running a Linux C compiled program for my project. The program
>> was in a script named as 'run0', see below. In the same directory,
>> there is another script file named: 'ex0'. In 'ex0', a C compiled
>> program named exec0.
>>
>> When I run './run0' at the prompt, it feedbacks:
>>
>> ./run0: line 10: ex0 command not found.
>>
>> I see that all the command exec needs './', but the provided script
>> without a single './' Because there are a lot of files called in the
>> script, I want to know how to make the Linux OPENSUSE run directly.
>
>    Put all scripts and executables in a direectory that is in your
>    $PATH, e.g. $HOME/bin
>
>> BTW, I have run:
>> $PATH=$PATH:.
>
>    That would give you an error; perhaps you meant:
>
> PATH=$PATH:.
> export PATH
>
>    But don't do that.

Putting . in $PATH _used_ to be standard practice.  I believe my
K&R mentiones just typing "a.out" to run a just-compiled program
with _no_ "./" in front of it.

Nowadays, it depends on your environment.  If you're talking
about the root account or an account at a university or in a
company where there is significant risk of a malicious user on
the inside, don't put . in $PATH.  However, for a non-root
account on a well-secured system with essentially zero likelihood
of a malicious user or prankster on the inside, there are _FAR_
more serious security fish to fry.

-- 
Robert Riches
spamtrap42@jacob21819.net
(Yes, that is one of my email addresses.)

Back to comp.os.linux.misc | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Why these program need './'? fl <rxjwg98@gmail.com> - 2011-05-12 19:56 -0700
  Re: Why these program need './'? "Chris F.A. Johnson" <cfajohnson@gmail.com> - 2011-05-12 23:11 -0400
    Re: Why these program need './'? Robert Riches <spamtrap42@jacob21819.net> - 2011-05-13 04:23 +0000
      Re: Why these program need './'? gazelle@shell.xmission.com (Kenny McCormack) - 2011-05-13 10:29 +0000
      Re: Why these program need './'? David Brown <david@westcontrol.removethisbit.com> - 2011-05-13 13:02 +0200
        Re: Why these program need './'? Todd Carnes <toddcarnes@gmail.com> - 2011-06-26 14:35 +0000
          Re: Why these program need './'? despen@verizon.net - 2011-06-26 19:10 -0400
          Re: Why these program need './'? unruh <unruh@wormhole.physics.ubc.ca> - 2011-06-27 09:52 +0000
            Re: Why these program need './'? blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2011-06-27 21:42 +0000
              Re: Why these program need './'? The Natural Philosopher <tnp@invalid.invalid> - 2011-06-27 22:59 +0100
              Re: Why these program need './'? David Brown <david@westcontrol.removethisbit.com> - 2011-06-28 08:46 +0200
                Re: Why these program need './'? blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2011-06-28 15:50 +0000
              Re: Why these program need './'? Richard Kettlewell <rjk@greenend.org.uk> - 2011-06-28 10:02 +0100
                Re: Why these program need './'? Jean-David Beyer <jeandavid8@verizon.net> - 2011-06-28 09:00 -0400
                Re: Why these program need './'? Grant Edwards <invalid@invalid.invalid> - 2011-06-28 14:21 +0000
                Re: Why these program need './'? blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2011-06-28 15:51 +0000
              Re: Why these program need './'? "Chris F.A. Johnson" <cfajohnson@gmail.com> - 2011-06-28 18:19 -0400
                Re: Why these program need './'? blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2011-06-29 19:54 +0000
  Re: Why these program need './'? Feranija <feranija@net...> - 2011-06-29 00:47 -0700

csiph-web