Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
Shells: User's Guide: HP 9000 Computers > Chapter 2 The Bourne Shell

UNIX System Structure

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

HP-UX is a fully compatible, enhanced version of UNIX™ System V. The structure of the system consists of several parts which work together to bring you the HP-UX operating system.

The kernel is the core of the HP-UX operating system. It controls the computer's resources and allots time to different users and tasks. The kernel keeps track of the programs being run and is in charge of starting each user on the system. However, the kernel does not interact with the user to interpret the commands. The shell is a program that the kernel runs for each user which sets up commands for execution. By having several shells and one kernel, HP-UX is able to support many users at the same time (the user's requests are not actually processed at the same time, but the kernel schedules processing time in a way which simulates concurrent processing). By having the kernel in control, it is also possible for one user to run several shells. The kernel remains in control of all shells and programs.

When you log on to the system, the kernel checks if your login identifier and password are correct. It then runs a shell program for you to interact with it (you never see this, only the shell after successful login). Most systems will start the POSIX Shell (/bin/posix/sh) as a default, but it is possible to run the Bourne Shell (/bin/sh), the C Shell (/bin/csh), or the Korn Shell (/bin/ksh). instead.

To give you an idea of processes and how the kernel schedules them, let's look at the ps command which lists the processes the kernel is currently coordinating. Type:

ps -ef

and receive a list similar to the following:

  UID   PID  PPID  C   STIME TTY  TIME COMMAND
davek 28125 28124 0 08:50:56 12 0:02 ps -ef
davek 28124 28091 0 08:50:55 12 0:00 sh -c ps -ef > temp
davek 28091 22022 0 08:23:17 12 0:51 vi programming
root 27781 1 0 06:47:58 co 0:01 /etc/getty console H 0
root 27097 1 0 23:51:47 05 0:03 /etc/getty tty05 H 0
root 27092 1 0 23:50:37 04 0:02 /etc/getty tty04 H 0
root 25740 1 0 11:59:58 03 0:01 /etc/getty tty03 H 0
root 24970 1 0 Aug 3 ? 0:01 /etc/getty tty99 3 240
root 22026 1 0 Aug 2 15 0:01 /etc/getty tty15 H 0
root 22024 1 0 Aug 2 14 0:02 /etc/getty tty14 H 0
root 22023 1 0 Aug 2 13 0:01 /etc/getty tty13 H 0
davek 22022 1 0 Aug 2 12 0:08 -sh

The UID column refers to the user identifier (the person who executed this process). PID refers to the process identifier. There are several commands which use the PID, such as kill. For example,

kill -9 28125

will kill (terminate) process 28125 (the first entry in the above list).

PPID is the process identifier of the parent process (the process that calls this process). The first row shows 28124 as the parent process. Look in the PID column for 28124 to see what the parent process is (shown on the second row).

The C column shows processor utilization for scheduling. STIME is the starting time of the process. TTY is the controlling terminal for the process. TIME is the cumulative execution time for the process, and COMMAND is the command name. For more details on the ps command, see the HP-UX Reference.

Before we begin the discussion on the Bourne Shell, let us first define some terms.

Definitions

The following are some definitions which will be used in this tutorial.

filename

The name of a file.

command_list

Either a line containing a command or several commands in a pipe, or several lines containing commands (pipes will be discussed later).

[ ]

Brackets used in a command syntax indicate the items enclosed are optional.

word

A command name.

string

A string of characters.

Conventions

This tutorial contains several different types of text displays:

computer

Used in screen printouts, for actual command names and file names, and in examples to show anything you are to type (i.e., varname=penguin means you type the entire string).

user input

Designates actual user response in a computer dialogue.

replaceable

In command examples, it refers to something you need to substitute for the indicated words (i.e., varname=variable_name means you actually type varname=, but you have to substitute an actual variable name in place of variable_name).

emphasis

Indicates text being emphasized, text to which you should pay particular attention.

term

Indicates a term used for the first time in the chapter.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-1991 Hewlett-Packard Development Company, L.P.