beautypg.com

11 managing processes, Understanding programs and processes, Redirecting input and output – HP NonStop G-Series User Manual

Page 135: Chapter 11: managing processes

background image

11 Managing Processes

This chapter discusses OSS processes. After completing this chapter, you will be able to do the
following:

Understand OSS programs and processes

Redirect process input, output, and errors

Run processes in the foreground and background

Check the status of processes

Cancel processes

Display information about users and their processes

Schedule jobs

A good way to learn about these topics is to try the examples in this chapter. You should do the
examples in the order given.

Understanding Programs and Processes

A program is a set of instructions that a computer can interpret and run. You can think of most
programs as being one of the following types:

Application programs, text editors, accounting packages, or electronic spreadsheets

Programs that are components of Open System Services, such as user commands and the
shell

While a program is running, it is called a “process.”

Every process is assigned a unique number, known as a “process identifier” or “process ID.”

Understanding Standard Input, Output, and Error Messages

When a process begins executing, Open System Services opens three files for it: stdin (the
standard input file), stdout (the standard output file), and stderr (the standard error file). These
files are as follows:

The standard input file is the place from which the program expects to read its input. By default,
processes read stdin from the keyboard.

The standard output file is the place to which the program writes its output. By default, processes
write stdout to the screen.

The standard error file is the place to which the program writes its error messages. By default,
processes write stderr to the screen.

There are times when it is useful to redirect input, output, and error messages to or from places
other than default locations for stdin, stdout, and stderr. The following subsections describe
how to redirect input, output, and error messages.

Redirecting Input and Output

A command usually reads its input from the keyboard (the standard input file) and writes its output
to the screen (the standard output file). On occasion, you will want a command to read its input
from a file, write its output to a file, or both. You can select input and output files for a command
using the appropriate shell notation (shown in

Table 25

) in the command line when you enter the

command.

Understanding Programs and Processes

135

This manual is related to the following products: