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


Groups > linux.debian.user > #185176

Re: Why debian put ~/bin beginning of $PATH

From Vincent Lefevre <vincent@vinc17.net>
Newsgroups linux.debian.user
Subject Re: Why debian put ~/bin beginning of $PATH
Date 2017-08-14 15:30 +0200
Message-ID <uenBo-4G7-19@gated-at.bofh.it> (permalink)
References <ucicO-4h6-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 2017-08-09 03:11:48 +0800, spp mg wrote:
> In the ~/.profile has below default setting:
> 
> --------------
> # set PATH so it includes user's private bin if it exists
> if [ -d "$HOME/bin" ] ; then
>     PATH="$HOME/bin:$PATH"
> fi
> --------------
> 
> Why put ~/bin beginning ? Is that dangerous ?

No, it's the opposite that is potentially dangerous. For instance,
you install some executable foo in your ~/bin, so that you can run
just "foo". Then, imagine that after some system upgrade or package
installation, a new executable "foo" gets installed somewhere in
the system path. So, when you run "foo", it will no longer be your
executable, but the system one, and if this executable is destructive,
you may lose data...

It is "." that must never be put in front of the path. Putting it
at the end might be OK, but this is not even recommended, due to
the above issue and also because you may run a wrong executable by
mistake.

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

Back to linux.debian.user | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Why debian put ~/bin beginning of $PATH spp mg <sm.sppmg@gmail.com> - 2017-08-08 21:20 +0200
  Re: Why debian put ~/bin beginning of $PATH Nicolas George <george@nsup.org> - 2017-08-08 21:40 +0200
  Re: Why debian put ~/bin beginning of $PATH John Elliot V <jj5@jj5.net> - 2017-08-08 21:40 +0200
  Re: Why debian put ~/bin beginning of $PATH Michael Lange <klappnase@freenet.de> - 2017-08-08 22:10 +0200
    Re: Why debian put ~/bin beginning of $PATH spp mg <sm.sppmg@gmail.com> - 2017-08-08 23:00 +0200
      Re: Why debian put ~/bin beginning of $PATH Michael Lange <klappnase@freenet.de> - 2017-08-08 23:30 +0200
      Re: Why debian put ~/bin beginning of $PATH Teemu Likonen <tlikonen@iki.fi> - 2017-08-09 06:50 +0200
        Re: Why debian put ~/bin beginning of $PATH Teemu Likonen <tlikonen@iki.fi> - 2017-08-09 07:00 +0200
      Re: Why debian put ~/bin beginning of $PATH "Gian Uberto Lauri" <saint@eng.it> - 2017-08-09 18:20 +0200
        Re: Why debian put ~/bin beginning of $PATH David Wright <deblis@lionunicorn.co.uk> - 2017-08-09 19:00 +0200
    Re: Why debian put ~/bin beginning of $PATH Greg Wooledge <wooledg@eeg.ccf.org> - 2017-08-09 15:20 +0200
  Re: Why debian put ~/bin beginning of $PATH soyeomul@doraji.xyz (Byung-Hee HWANG (황병희, 黃炳熙)) - 2017-08-11 16:00 +0200
  Re: Why debian put ~/bin beginning of $PATH Vincent Lefevre <vincent@vinc17.net> - 2017-08-14 15:30 +0200

csiph-web