-->

Previous | Table of Contents | Next

Page 45

which are unscaled values. The return status is 0 unless an illegal option is encountered, a non-numeric argument other than unlimited is supplied as limit, or an error occurs while setting a new limit.
umask [_S][mode] The user file-creation mask is set to mode. If mode begins with a digit, it is interpreted as an octal number; otherwise, it is interpreted as a symbolic mode mask similar to that accepted by chmod(1). If mode is omitted, or if the _S option is supplied, the current value of the mask is printed. The _S option causes the mask to be printed in symbolic form; the default output is an octal number. An argument of — disables option checking for the rest of the arguments. The return status is 0 if the mode was successfully changed or if no mode argument was supplied, and False otherwise.
unalias [_a][name ...] Remove names from the list of defined aliases. If _a is supplied, all alias definitions are removed. The return value is True unless a supplied name is not a defined alias.
unset [_fv][name ...] For each name, remove the corresponding variable or, given the _f option, function. An argument of — disables option checking for the rest of the arguments. Note that PATH, IFS, PPID, PS1, PS2, UID, and EUID cannot be unset. If any of RANDOM, SECONDS, LINENO, or HISTCMD are unset, they lose their special properties, even if they are subsequently reset. The exit status is True unless a name does not exist or is non-unsettable.
wait [n] Wait for the specified process and return its termination status. n may be a process ID or a job specification; if a job spec is given, all processes in that job's pipeline are waited for. If n is not given, all currently active child processes are waited for, and the return status is zero. If n specifies a nonexistent process or job, the return status is 127. Otherwise, the return status is the exit status of the last process or job waited for.

INVOCATION

A login shell is one whose first character of argument zero is a _, or one started with the _login flag.

An interactive shell is one whose standard input and output are both connected to terminals (as determined by isatty(3)), or one started with the _i option. PS1 is set and includes i if bash is interactive, allowing a shell script or a startup file to test this state.


Login shells:

On login (subject to the _noprofile option):

if /etc/profile exists, source it.

if ~/.bash_profile exists, source it,

else if ~/.bash_login exists, source it,

else if ~/.profile exists, source it.

On exit:

if ~/.bash_logout exists, source it.

Non-login interactive shells:

On startup (subject to the _norc and _rcfile options):

if ~/.bashrc exists, source it.

Non-interactive shells:

On startup:

if the environment variable ENV is non-null, expand

it and source the file it names, as if the command

if [ "$ENV" ]; then . $ENV; fi

had been executed, but do not use PATH to search

for the pathname. When not started in Posix mode, bash

looks for BASH_ENV before ENV.

If Bash is invoked as sh, it tries to mimic the behavior of sh as closely as possible. For a login shell, it attempts to source only /etc/profile and ~/.profile, in that order. The _noprofile option may still be used to disable this behavior. A shell invoked as sh does not attempt to source any other startup files.

Page 46

When bash is started in posix mode, as with the _posix command line option, it follows the POSIX standard for startup files. In this mode, the ENV variable is expanded and that file sourced; no other startup files are read.

SEE ALSO

Bash Features, Brian Fox and Chet Ramey

The Gnu Readline Library, Brian Fox and Chet Ramey

The Gnu History Library, Brian Fox and Chet Ramey

A System V Compatible Implementation of 4.2BSD Job Control, David Lennert

Portable Operating System Interface (POSIX) Part 2: Shell and Utilities, IEEE

sh(1), ksh(1), csh(1), emacs(1), vi(1) readline(3)

FILES

/bin/bash The bash executable
/etc/profile The systemwide initialization file, executed for login shells
/.bash_profile The personal initialization file, executed for login shells
/.bashrc The individual per-interactive-shell startup file
/.inputrc Individual readline initialization file

AUTHORS

Brian Fox (Free Software Foundation; primary author; bfox@ai.MIT.Edu), Chet Ramey (Case Western Reserve University; chet@ins.CWRU.Edu)

COPYRIGHT

Copyright " 1989, 1991 by the Free Software Foundation, Inc.

BUG REPORTS

If you find a bug in bash, you should report it. But first, you should make sure that it really is a bug, and that it appears in the latest version of bash that you have.

Once you have determined that a bug actually exists, mail a bug report to bash_maintainers@prep.ai.MIT.Edu. If you have a fix, you are welcome to mail that as well! Suggestions and "philosophical" bug reports may be mailed to bug-bash@prep.ai.MIT.Edu or posted to the Usenet newsgroup gnu.bash.bug.

ALL bug reports should include the following:

The version number of bash

The hardware and operating system

The compiler used to compile

A description of the bug behavior

A short script or "recipe" that exercises the bug

Comments and bug reports concerning this manual page should be directed to chet@ins.cwru.edu.

BUGS

It's too big and too slow.

There are some subtle differences between bash and traditional versions of sh, mostly because of the POSIX specification.

Aliases are confusing in some uses.

GNU, 9 March 1995

Previous | Table of Contents | Next