Skip to Main Content
Linux in a Nutshell, Fourth Edition
book

Linux in a Nutshell, Fourth Edition

by Ellen Siever, Stephen Figgins, Aaron Weber
June 2003
Beginner to intermediate content levelBeginner to intermediate
944 pages
43h 1m
English
O'Reilly Media, Inc.
Content preview from Linux in a Nutshell, Fourth Edition

Name

set

Synopsis

                  set [options] [arg1 
                  arg2 
                  ...]

With no arguments, set prints the values of all variables known to the current shell. Options can be enabled (-option) or disabled (+option). Options can also be set when the shell is invoked, via bash. Arguments are assigned in order to $1, $2, and so on.

Options

-

Turn off -v and -x, and turn off option processing.

--

Used as the last option; turn off option processing so that arguments beginning with - are not misinterpreted as options. (For example, you can set $1 to -1.) If no arguments are given after --, unset the positional parameters.

-a

From now on, automatically mark variables for export after defining or changing them.

-b

Report background job status at termination instead of waiting for next shell prompt.

-e

Exit if a command yields a nonzero exit status.

-f

Do not expand filename metacharacters (e.g., * ? [ ]). Wildcard expansion is sometimes called globbing.

-h

Locate and remember commands as they are defined.

-k

Assignment of environment variables (var = value) will take effect regardless of where they appear on the command line. Normally, assignments must precede the command name.

-m

Monitor mode. Enable job control; background jobs execute in a separate process group. -m usually is set automatically.

-n

Read commands, but don’t execute. Useful for checking errors, particularly for shell scripts.

-o [m]

List shell modes, or turn on mode m. Many modes can be set by other options. The modes can be turned off through the ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Linux in a Nutshell, 6th Edition

Linux in a Nutshell, 6th Edition

Ellen Siever, Stephen Figgins, Robert Love, Arnold Robbins
Linux in Action

Linux in Action

David Clinton
Hands-On System Programming with Linux

Hands-On System Programming with Linux

Kaiwan N. Billimoria, Tigran Aivazian
Embedded Linux for Developers

Embedded Linux for Developers

Alexandru Vaduva, Alex González, Chris Simmonds

Publisher Resources

ISBN: 0596004826