Subject: Re: HELP : some newbie questions
To: Fabiano Petrone <fabiano.petrone@bib.uniud.it>
From: CyberPeasant <listread@bedford.net>
List: netbsd-help
Date: 02/11/1998 13:30:11
[Followups to netbsd-help.]

> Hi to everybody.
> Before all, excuse the cross-posting to 2 lists (netbds-help and netbsd-mac)
> I've 3 questions : I hope not FAQ ones...
> I've mounted NetBSD 1.3 on my 68k macintosh LC 630 (with the generic
> kernel) and I'm following the Kochan's book "exploring the UNIX system" as
> an introductory guide to the unix word.
> here are the 3 questions. In all the examples I've logged as "root":
> 
> 1. I've tried a simple pipe like "who | wc -l" and it works OK. I've saved
> this pipe in a file on /root/pub (call it "file") and I've chmoded it as
> executable with "chmod +x file".

The file should look like:

#!/bin/sh
who | wc -l

> well, the problem is that when I call "file" from the prompt #, the system
> respond "file : not such command" : why?

Two possibilities:  the directory /root/pub is not in root's path.
The other: you didn't real name it "file", since there is already a
command "file", which (99.9999 sure) is in root's path. I bet both of
these are true.  Assuming you are cd'd to /root/pub, do

	./what-you-really-named-it

(The very name "/root/pub" makes me shiver with security terror.)

You can add the current working directory to a path by executing
	# PATH=$PATH:.
under Bourne shells. This is not recommended (security) for root.

> 2. I've FTP'ed the Unix perl package and I'd like to install it on NetBSD.
> is it possible? where can  I find the instructions to do so? is this
> "enterprise" something that also a newbie like me can do?

Unpack the package, the look for a file named INSTALL.txt. Depending on
where you got perl from, this may be a separate file at the FTP site.
If you can't locate it, email me privately (djv@bedford.net), and
you'll get the file through the magic of Email. Follow its instructions.
Email me when it fails. :) There may be an option somewhere to specify
that you would like to use the malloc routines from libc instead of from
somewhere else.  Say yes. You may have to look for this.

The perl system is a wee bit large. Start with something smaller, that
will work easily, to demonstrate what's involved.

The smallest thing I know of is the FSF's demo named "hello.???.tar.gz".
This is the familiar program of the same name, but tar'ed, compressed,
documented and so on like larger FSF products. Do this one first, and
look through everything involved with it. (ftp from prep.ai.mit.edu )
Download it into a directory (a normal user's, not root's ... see below),
and unpack it while you are cd'd to that directory, using
	tar -xzvf hello.?????.tar.gz
where ????? is whatever is there. (It will be a version number).
This will create a subdirectory hello.??????; cd there and look for
README or INSTALL.  Read them :)  Read up about tar. (man tar).

Other people will tell you to use the "package" system, which is a different
way of handling these things, presumably with less effort, and therefor
less learning. A newbie should do things by hand at first. Don't do things
blindly.

> 3. last : I've tried to define simple shell variables like:
> 
> # lenght=80
> 
> but when I try something like
> 
> #echo $lenght
> 
> I can't obtain the result expected (80): why? I guess a kernel problem?

The kernel is not directly involved with these variables.  Recall that
Unix is 25 years old; although there remain some bugs in the kernel,
something this basic would have been fixed long ago. (I.e. this isn't
Linux, and it *sure* isn't NT). Blame the kernel last.

I am willing to bet that either your spelling was off, or that the
echo was being invoked from a subshell (i.e. from a shell script).
In the latter case, you would like to make lenght [sic] part of the
subshell's environment; the is done by "exporting" it. Under Bourne
family shells, this is done by:   (man sh)

	# lenght=80
	# export lenght

ADVICE: When reporting bugs, do not change the names of things, (like "file"),
and report both what you hoped would happen, and what really did happen.

ADVICE:  Do not perform experiments as root.  You will be making mistakes,
and with root privilege, they can be very painful.  You probably
won't follow this advice :), will ruin the system and then have to
reinstall. Then you will be "blooded", and have the permanent right to give
this advice to others. Always pause before pressing return when root.

Dave
-- 
PGP public key:  finger djv@bedford.net

       --== There are Greeks in that horse! I can hear them! ==--