The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: wkt@tuhs.org (Warren Toomey)
Subject: [TUHS] PATH variable
Date: Sat, 3 May 2008 14:45:19 +1000	[thread overview]
Message-ID: <20080503044519.GA43894@minnie.tuhs.org> (raw)
In-Reply-To: <20080502.221259.74661438.imp@bsdimp.com>

On Fri, May 02, 2008 at 10:12:59PM -0600, Warner Losh wrote:
> So when did the PATH variable get introduced?

The 1e manual says: If the 1st argument represents the path name of an
executable file, it is invoked; otherwise the string "/bin/" is prepended
to the argument. In this way the standard commands, which reside in "/bin"
are found.

The 3e manual extends the above: If no such command is found,
the string "/usr" is further prepended (to give "/usr/bin/command") and
another attempt is made to execute the resulting file. (Certain "overflow"
commands live in "/usr/bin".)  If the "/usr/bin" file exists, but is not
executable, it is used by the shell as a command file.
That is to say it is executed as though it were typed from the console.

Manuals for 4e, 5e and 6e all say the above. The 7th Edition manual is
the first to say:

The shell parameter $PATH defines the search path for the directory containing
the command. Each alternative directory name is separated by a colon (:)
The default path is :/bin:/usr/bin. If the command name contains a / then the
search path is not used. Otherwise, each directory in the path is searched for
an executable file. If the file has execute permission but is not an
a.out file, it is assumed to be a file containing shell commands.

Cheers,
	Warren



      reply	other threads:[~2008-05-03  4:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-03  3:23 [Unix-jun72] login prompt! Tim Newsham
2008-05-03  3:25 ` Tim Newsham
2008-05-03  3:36   ` Warren Toomey
2008-05-03  3:47     ` Tim Newsham
2008-05-03  4:51       ` [Unix-jun72] What next? Warren Toomey
2008-05-03  4:56       ` [Unix-jun72] replacing mount.s Warren Toomey
2008-05-03 10:22       ` [Unix-jun72] login prompt! Brad Parker
2008-05-03  3:47   ` Warren Toomey
2008-05-03  4:12   ` Warner Losh
2008-05-03  4:45     ` Warren Toomey [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080503044519.GA43894@minnie.tuhs.org \
    --to=wkt@tuhs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).