HELP SHELL                           Jonathan Laventhol, 5 October 1983.
                                      Modified by Tom Khabaza, A. Sloman

CONTENTS

    - (Use <ENTER> g to access desired sections)

 -- INTRODUCTION
 -- RECOGNISING THE SHELL
 -- INITIALISATION OF POPLOG
 -- LISTING AND REMOVING YOUR FILES
 -- DELETING FILES
 -- INCOMPLETE FILENAMES
 -- GETTING TO THE SHELL TEMPORARILY
 -- FOR THOSE WITH CONFIDENCE
 -- USE OF '!'
 -- TEMPORARILY RETURNING TO ORIGINAL SHELL (ENTER stop)
 -- MOVING AND COPYING FILES
 -- SENDING AND READING MESSAGES (Electronic mail)
 -- PRINTING FILES
 -- PASSWORDS
 -- SUMMARY OF SHELL COMMANDS
 -- ASSOCIATED DOCUMENTATION

-- INTRODUCTION -------------------------------------------------------

On UNIX operating systems two kinds of 'SHELL' program can be found,
one simply called 'SH' the other 'CSH' and known as the 'CSHELL', as
found on the sea shore. Both enable you to give a range of commands,
e.g. to read mail, copy files, list the files in your directory, and run
any programs available on the machine. However, the CSHELL is a bigger
more powerful program, and is not available on all UNIX systems, whereas
there is always a version of 'SH'.

Both allow you to specify a 'login command file' in your home
directory, to enable you to control terminal settings and other things.
For the CSHELL the file is called '.login', and for the SHELL
'.profile'. For details consult your local UNIX expert, or manuals. If
you don't have one of these set up suitably you will not be able to run
POPLOG.

To find out full details you will have to read UNIX manuals see HELP
*MAN. You can tell which sort of shell you are interacting with when you
log in by the 'prompt' printed out to invite you to type a command. SH
prints '$' and CSH prints '%'. In all the following it is assumed that
you are using the CSHELL, and therefore our examples all use '%'. If you
wish to run SH instead (e.g. because it will often be noticeably faster)
or if you only have SH available on your machine, change '%' to '$' in
all the instructions and examples below. (See also USE OF '!' below.)

The remainder of this file describes how to deal with the shell, in
order to delete files find out what files you have, send mail, etc. This
is solely an introductory guide, and doesn't give you full information.

(Before you read the rest of this file, please check you've read
HELP *TTY to find out what a few keys on the terminal do.  Otherwise
some things won't make sense.)

-- RECOGNISING THE SHELL ----------------------------------------------

You will know that you are in the shell by the prompt that the computer
prints at you -- it is a percent sign (%) for the Cshell, and a dollar
($) for other shells.

When you log in you will get the shell prompt.  Normally you will just
want to go straight into POP11 or Prolog.  Just type the name of the
language you want:

        % pop11
 or     % prolog
 or     % lisp

(Don't type the '%' - that's the prompt printed out by the shell.)

To leave POP11 (or Prolog), just press the end-of-file key (see
HELP *TTY), and then you will be back talking to the shell. The
end-of-file key is generally used to indicate that you have finished
with some process, and want to get back to where you were before you
started it. In particular, if you type it to the shell, the shell will
stop, and if that is the shell process which ran when you logged in,
stopping it will have the effect of logging you out.

Some versions of shell allow you to put something into your login start
up command file to prevent accidental logouts caused by pressing the
end-of-file key. You can normally then log out by typing, to CSHELL

        % logout

or, to SHELL

        $ exit

PLEASE DON'T FORGET TO LOG OUT -- Someone else might want to use
your terminal.

-- INITIALISATION OF POPLOG -------------------------------------------

The following files contain information on the process of starting up
POPLOG including;

    Environment variables
    Setting up the environment
    Search paths used when POPLOG starts up
    Directories
    Running POPLOG
    Using initialisation files to tailor the system
    Initialisation files for POP-11 Prolog Lisp and VED
    Changing $poplib
    Tailoring POP-11
    Tailoring Prolog
    Tailoring Common Lisp
    Initialising VED
    VED Search lists
    Tailoring VED for Individual files
    Examples of tailoring and initialisation files
    Running saved images
    Layered saved images
    Running POPLOG with parameters
    Running UNIX saved images with no abbreviation facility

    *INITIAL        - initialisation and tailoring of POPLOG
    *INITIAL.EX     - examples of initialisation procedures
    *PARAMETERS     - passing command line parameters to POP-11

-- LISTING AND REMOVING YOUR FILES ------------------------------------

Before (or after) running POPLOG, you may wish to find out which files
you have. You can give a shell command to do this.

What files do I have?

        % ls

will print out a list of all the files you have.

        % ls -l

will give a 'long' listing, indicating the protection, the number of
'links' to the file, the owner of the file, the size (number of
characters in the file), the creation date and time, and finally the
name of the file.

See also
    *CD             - changing directory in POP-11 or VED
    *LS             - listing files

-- DELETING FILES -----------------------------------------------------

How do I get rid of files?

        % rm filename

will remove the file called "filename".

See also
    *DEL            - deleting files
    *PURGE          - purging files

-- INCOMPLETE FILENAMES -----------------------------------------------

When you give filenames to the shell, you can leave parts out, by
putting "wildcards" in the name.  There are two main wildcards in the
shell, the asterisk (*), and the question mark (?).  You can use the
question mark to stand for any single character.  The asterisk will
stand for any number of characters.

So if you wanted to get rid of all the files in your area which end
with 'tmp', you could do

        % rm *tmp

WARNING

        % rm *

will delete all your files. So will

        % rm * tmp

so will

        % rm tmp *

so be careful about typing asterisks in an 'rm' command.

Or to find out which files end with 'tmp', you can try

        % ls *tmp

(This is especially useful to find out what %rm *tmp would remove.)

-- GETTING TO THE SHELL TEMPORARILY -----------------------------------

In the middle of working with POP11 (or Prolog), you can give a single
command to the shell just by prefacing the command with a percent sign:
     : % ls

will print out your files, but leave you inside POP11.

Of course, if you want to get back to the shell permanently, you can
leave POPLOG by pressing the end-of-file key.

See also
    *STOP           - suspending processes
    *IMCSH          - CSH in VED (immediate mode)
    *IMSH           - SH in VED (immediate mode)
    *VED_CSHFILE    - running a csh in VED
    *CSH_COMPILE    - a csh compiler

-- FOR THOSE WITH CONFIDENCE ------------------------------------------

This section explains how to suspend POPLOG, and invoke the shell in
such a way that you can type a sequence of commands to it, without
repeatedly coming back to POPLOG.

If you want to give a sequence of commands to the shell, you can
take an excursion from POP-11 when you get its prompt (or the Prolog or
lisp propt) by just typing a percent sign like this:

        : %

(Here the ':' is the POP-11 prompt - you don't type it. Just type '%' -
or '$' if appropriate - then press the RETURN key.)

This suspends your POPLOG process and starts a new shell process
('Cshell' if you type '%', shell if you type '$'). You will get the
appropriate prompt, and can give a sequence of shell commands. Your
POPLOG process will wait for you to finish with the shell by pressing
the END-OF-FILE KEY. At that point, the suspended POPLOG process will
'wake up' and you can continue where you were with it.

N.B. When you've finished giving shell commands, and want to go back
PRESS THE END-OF-FILE KEY ONCE. This will take you back to POPLOG (i.e.
POP-11, Prolog, Lisp or VED).

If you press it twice, you will leave the invocation of the shell, go
into POP11, then leave POPLOG and go into the shell you first started
with. The invocations of POPLOG and the shell are said to "nest". It is
important that you keep track of how nested you are.)

If you invoke a nested shell, DO NOT type 'pop11' or 'ved' or 'prolog'
to it to get back to where you were in POPLOG. Doing this will start up
a NEW POPLOG process, and you will probably lose the edits you have been
doing when you finally get out of all the nested processes.

Instead of invoking a new process by giving a command, simply press the
end-of-file key to get back to where you were. If it doesn't work, try
typing 'exit' to the shell.

If this sounds too confusing, just play safe and use the percent sign in
front of every shell command to POPLOG.

Use '$' if you only have SH available. (If you don't know which to use ,
you can use '!' and let POPLOG decide what to do!)

-- USE OF '!' ---------------------------------------------------------

In some cases, you can use '!' instead of either '%' or '$' in POPLOG.
This tells POPLOG to decide for itself which shell to invoke. It does
this by looking at the 'environment variable' called 'SHELL', set up
when you log in, and choosing the shell program denoted by that. The
pop11 command

    systranslate('SHELL') =>        ;;; note upper case

will print out the name of the relevant program file, preceded by the
directory in which it is stored.

e.g.
    ** /bin/csh
or
    ** /bin/sh

See also
    *INITIAL        - initialisation and tailoring of POPLOG
    *INITIAL.EX     - examples of initialisation procedures

-- TEMPORARILY RETURNING TO ORIGINAL SHELL (stop and ENTER stop) ------

A more  convenient  and  economical  mechanism  is  also  available  for
temporarily going back to the SHELL  from which you ran POP-11. This  is
only available on Berkeley Unix systems with the C-SHELL.

If you type

    : stop

to top level, or

    <ENTER> stop

to VED, then the POP-11 process will be suspended and you will go back
to the C-SHELL (CSH). When you wish to return to POP-11 you will need to
type a '%' (i.e. percent sign) to CSH. In fact the CSH allows you to
start a number of processes and switch between them by suspending them
and then re-connecting. You can find out at any time how many such
processes you have by typing

    % jobs

to CSH. The processes will be printed out with numbers. If you have more
than one, you can attach to number 3 by typing

    % %3

(the first '%' is just the CSH prompt). See the CSH manual.
See also
    *STOP           - suspending processes
    *IMCSH          - CSH in VED (immediate mode)
    *IMSH           - SH in VED (immediate mode)
    *VED_CSHFILE    - running a csh in VED
    *CSH_COMPILE    - a csh compiler

-- MOVING AND COPYING FILES -------------------------------------------

If you want to move a file from one place to another, use the "mv"
command, like this:

     % mv oldname newname

(This is how you change the name of a file -- by moving it to a
different name.)

If you want to create a copy of a file, you can use the "cp" command for
example

      % cp old new

will make a copy of the file "old", and call it "new". If you previously
had a file called 'new' it will be deleted!!

-- SENDING AND READING MESSAGES (Electronic mail) ---------------------

You can send messages via a program called "mail". (American system
hence American word).  When you log in you will get a message if you
have a mail waiting for you.  It says "You have mail". You can read your
mail like this:

       % mail

It will print out a numbered list of the messages you have. You can read
a particular message by typing its number, or by pressing return you get
the next message.  To get rid of the message you've just read, type "d"
(for Delete), then return. After you delete a message, to see the next
message, type "t" (for Type).

Sending mail to others works like this:

        % mail rudi susan
        ... this is my message to you rudi ...

        <end-of-file>

(<end-of-file> means press the end-of-file key.  If you typed it out it
would be part of the message to Rudi and Susan.)

You can get get in the mail system by typing a '?' to the mail prompt
as follows:

    & ?

The are also some POPLOG HELP files on mail
See
    *MAIL           - UNIX mail facility
    *VED_MAIL       - mail in VED
    *VED_MDIR       - organising mail in VED
    *VED_REPLY      - replying to mail in VED
    *SEND           - sending mail from VED

-- PRINTING FILES -----------------------------------------------------

You can have a file printed on your local printer like this:

        % print filename

In general how things are to be printed out will vary from one
installation to another, so please consult your system manager about
printing files.

See also
    HELP *PRINTING
    HELP IO - overview of IO in POPLOG

-- PASSWORDS ----------------------------------------------------------

    Passwords ...

Some people like to have passwords, so that nobody can log in as
them (and e.g. delete all their files or read their mail) unless they
know the (secret) password.  Each person can have their own password.
You get (or change) a password by

     % passwd

it will ask you for your old password (if you've got one), and the new
password twice, just to make sure.  Sometimes it won't like the new
password because it's too short or something.  Just think up a longer
one.

See also
    *SYSGETPASSWDENTRY - getting information on users

-- SUMMARY OF SHELL COMMANDS ------------------------------------------

A summary of common "shell" commands; for most users of Poplog (who will
be using the "cshell"), these are typed to the "% " prompt. See HELP
*SHELLSUMM

-- ASSOCIATED DOCUMENTATION -------------------------------------------

HELP
    *CD             - changing directory in POP-11 or VED
    *DEL            - deleting files
    *HASH_          - evaluation at compile time
    *IMCSH          - CSH in VED (immediate mode)
    *IMSH           - SH in VED (immediate mode)
    *VED_CSHFILE    - running a csh in VED
    *CSH_COMPILE    - a csh compiler
    *INITIAL        - introduction to initialisation and tailoring
                      POPLOG
    *INITIAL.EX     - examples of initialisation procedures
    *KILLCSH        - killing CSH processes
    *LS             - listing files
    *MAIL           - the mail facility
    *VED_MAIL       - mail in VED
    *VED_MDIR
    *VED_REPLY
    *PARAMETERS     - intialising POPLOG with parameters
    *PIPEUTILS      - passing output of POPLOG to UNIX through a pipe
    *POP_FILE_MODE  - variable controllong file default protection
    *POPENVLIST     - list of environment variables
    *PURGE          - purging files
    *SEND           - sending mail from VED
    *SERR           - information on a system error message
    *STOP           - suspending processes
    *SYS_IO_CONTROL - system io control
    *SYSEXECUTE     - POP-11 prcedure which does a UNIX "execve"
    *SYSFILEMODE    - accessing and changing protection on files
    *SYSFORK        - forking POPLOG processes
    *SYSGETPASSWDENTRY - getting information on users
    *SYSOBEYLIST    - executing UNIX commands in POP-11
    *SYSOBEY
    *SYSPIPE        - creating UNIX pipes
    *SYSTRANSLATE   - getting the valu of environment variables
    *TTY            - key functions
    *UNIX           - more on UNIX
    *VEDEMACS       - an EMACS simulation
    *SYSUTIL        - general facilities for interfacing POPLOG and UNIX
    *SYSIO          - IO behavoiur of POPLOG
    *IO             - overview of IO facilities in POPLOG

--- C.unix/help/shell --------------------------------------------------
--- Copyright University of Sussex 1988. All rights reserved. ----------
