How the shell finds commands – HP NonStop G-Series User Manual

Page 50

Advertising
background image

Table 10 Description of Example .profile File (continued)

Description

Line

Specifies vi as the default editor for command-line editing at the
shell prompt and for filename completion.

EDITOR=vi

Specifies vi as the default editor for the fc command.

FCEDIT=vi

PS1

is the variable that specifies the shell prompt, and its default

value is $. However, this variable assignment specifies that the

PS1="'hostname' [!] $ "

prompt be changed to the output of the hostname command,
followed by the command number of the current command, followed
by the $ (dollar sign). For example, if the name of your system is
boston

, and the current command is numbered 30, your prompt

would be the following: boston[30] $ .

Specifies that the terminal type you are using is xterm

TERM=xterm

Comment line.

# Export global variables

Specifies that the values of the PATH, MANPATH, ENV, EDITOR,
FCEDIT

, PS1, and TERM variables should be exported to all

subshells.

export PATH MANPATH ENV EDITOR

FCEDIT PS1 TERM

Comment line.

# Set shell variables

Specifies that the shell should monitor all background processes and
display a completion message when any background process
finishes.

set -o monitor

Specifies that the shell should track all commands that you execute.
Once a command is tracked, the shell stores the location of the

set -o trackall

command and finds the command more quickly the next time you
enter it.

Specifies that when redirection is used in OSS commands, existing
files will not be overwritten.

set -o noclobber

Comment line.

# Set command aliases

Specifies rm as the alias for the use of the -i option (which prompts
you for file deletion) with the rm command.

alias rm='rm -i '

Specifies rename as an alias for the mv command.

alias rename='mv '

Defines h as an alias for a command that pipes the contents of the
command history buffer through the more command. The !* string
specifies that all of the history buffer should be piped.

alias h 'history !* | more'

Defines l as an alias for the ls -l command that lists directory
files in the long format.

alias l 'ls -l'

Defines c as an alias for the clear command that clears your
screen.

alias c clear

Comment line.

# Set history variables

Instructs the shell to store the last 40 commands in the history buffer.

HISTSIZE=40

Comment line.

# Set file creation permissions

Specifies the maximum permissions for all new files created. This
command provides all permissions for the owner, read and execute

umask 027

permissions for members of the same group, and no permissions for
all others.

How the Shell Finds Commands

Every time you enter a command, the OSS shell searches through a list of directories to find the
command. This list of directories is specified by the PATH environment variable. For many systems,

50

The OSS Shell

Advertising
This manual is related to the following products: