Re: PATH, HOME, and ~

"Beartooth" <beartooth-iVX72re7JJ/[email protected]> 24 Jun 2006 12:48:37 -0500
Newsgroups gmane.org.infiniteink
Message-ID <[email protected]>
On Thu, 22 Jun 2006 14:27:30 +0100, NM Public wrote:

> One of the reasons I decided to start using this Infinite Ink 
> group again is because of a discussion I was participating in in 
> comp.mail.pine that veered off on a lot of tangents that are not 
> necessarily interesting to Pine users. One of the topics brought 
> up by Beartooth is this:
> 
> "Incidentally, I'm having troubles getting straight what PATH, 
> HOME, and ~ are; and of course that's no part of a pine topic, 
> but a prerequisite; otoh, there's nothing, apparently, in man 
> pages, info pages, --help, or -h for them."
> 
> The traditional place to learn about these is in the man page 
> for your shell, for example one of these:
> 
>   man bash
>   man tcsh
> 
> To find out what shell you are using, run one of these:
> 
>   finger username
>   printenv SHELL
> 
> E.g.:
> 
>   finger beartooth
> 
> I recommend that everyone who spends a lot of time at a 
> Unix-like command-line prompt read the man page for your shell!

Well, I happened to know already that I run bash, both remotely and at
home. I had even tried to read man bash -- and given up in despair -- a
couple times before, though I didn't know anyway to search it. 

<rant mode on>

Man bash, like so many man pages, is written as review for Alpha Plus
Technoids. If you're not one, it puts you in the position of some poor
soul needing to know a few basic facts, say, about integrals and
derivatives, who doesn't know any analytic geometry or trig -- and who
tries to learn what he needs by picking up a third-year calculus text, if
not one on the theory of real variables. 

I could draw similar parallels with theory of library cataloging, or
Germanic philology, but I doubt those would have much appeal. 

(Fw little iw, I happen to have a BA in advanced math, with honors, from
Harvard -- but that was nearly half a century ago, before any of this
existed -- and it was purest of pure math at that : set topology, and
Goedel's Proof, and proofs of equivalence between Zorn's Lemma, the Axiom
of Choice, and some third form whose very name I disremember. Stuff like
that, lots of it. One course *derived* every single blasted formula in
Peirce's Tables! It keeps me from being scared of mere abstrusity, but
it's not much practical help. In fact, we still quoted GH Hardy boasting
of the uselessness (and beauty) of number theory. <sigh>)

As my sainted mother used to put it, "The first guy hasn't got a chance."
He doesn't know what's being talked about, nor so much as what to look up
first. And if he just starts looking up every strange thing he comes to
(supposing he can keep track), pretty soon the explanations and even
definitions are going to look circular to him. Not that they are -- just
that they assume things about their reader (as does any piece of writing,
of course) -- and he's not that reader. 

It's not the fault of the man page reader. Her assumptions fit the reader
she rightfully expects. But the poor sap of a "first guy" needs a primer,
before he can read the real technoid stuff. And btw, the Dummies books and
their ilk are no primers -- they have recipes, devoid of theory, and thus
don't rightly *explain* anything.

<rant mode interruptus>

> To get you started learning about PATH, HOME, and ~, type each of the
> following at a command-line prompt:
> 
>   printenv PATH
>   printenv HOME
>   printenv
> 
> These 3 commands 'print' something about your shell's environment.
> Details are in the man pages.

<sigh -- rant mode resumes ... >

I did the commands. The first two were at least short; and HOME did turn
out to be simply /home/btth, as I had hoped, at least in the cases I
recently needed. But staring at this doesn't tell me anything :

[btth@localhost ~]$ printenv PATH
/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/btth/bin
[btth@localhost ~]$

To be sure, I realize the colons separate files, in each of which I can
presume there is something about PATH; but I didn't even know I had
Kerberos installed. I thought I had chosen against it, on the supposition
that running it would be beyond me. 

Similarly, I guess X11R6 must have something to do with a GUI, since I
have had to edit xorg.conf when changing monitors, and X11 stuff was in
the path from /etc to that.

What's worse, neither Fedora/Gnome's GUI representation of "btth's home"
nor "ls -a | grep bin" from btth's initial prompt shows me any such file
as bin or .bin anywhere inside /home/btth. So afaik not even brute force
will work -- I can't go to all the files "printenv PATH" lists and read
through them for comprehensible tidbits, because I can't even get to
them. Or do I have to do all these as root??

<rant mode back into abeyance>

> To learn about '~', read the 'Tilde Expansion' section of the man page
> for your shell, e.g., type 'man bash' and then do a search by typing:
> 
>   /Tilde Expansion
>   n
>   n
> 
> where you type 'n' (next) as many times as you need to get to the Tilde
> Expansion section of the man page.

<rant mode re-resumes>

Did that, too; and it only took hitting n twice. I read it; but I might as
well have been reading Ancient Greek out loud, for all the sense it made
-- just because, as so often in man pages, it was everywhere dense with
unfamiliar jargon. Try reading Beowulf, or the Hildebrandslied, in the
original.

> In most of the instructions that I wrote for Beartooth, '~' was a
> synonym for $HOME, but note that this is not always the case.
> 
> If anyone has any comments or suggestions for good ways to learn about
> this stuff, please post a followup in this thread.

-- Or a URL, or a bibliographical reference, or something -- yes, pretty
please! With sugar on it. I'm way too old to go take a freshman course in
CS, and I wanna primer! One with *theory* in it! <he howled, gazing at the
moon>.

-- 
Beartooth Staffwright, Wordcrafty Squirreler
FC5; Pine 4.64, Pan 0.14.2.91; Privoxy 3.0.3; CXO 5.0.1
Dillo 0.8.6..., Opera 9.0, Firefox 1.5.0.4, Galeon 2.0.1
Remember I have little idea what I am talking about.