Skip to Content
bash Cookbook, 2nd Edition
book

bash Cookbook, 2nd Edition

by Carl Albing, JP Vossen
October 2017
Beginner to intermediate
723 pages
15h 31m
English
O'Reilly Media, Inc.
Content preview from bash Cookbook, 2nd Edition

Appendix A. Reference Lists

This appendix collects many tables of values, settings, operators, commands, variables, and more in one place for easy reference.

bash Invocation

Here are the options you can use when invoking current versions of bash. The multi-character options must appear on the command line before the single-character options. Login shells usually have the options -i (interactive), -s (read from standard input), and -m (enable job control) set internally.

In addition to those listed in Table A-1, any set option can be used on the command line; see “set Options”. In particular, the -n option is invaluable for syntax checking (see Recipe 19.12), and -x is used for debugging (Recipe 19.13).

For further reference, see http://bit.ly/2wtEjA8.

Table A-1. Command-line options to bash
Option Meaning

-c string

Commands are read from string, if present. Any arguments after string are interpreted as positional parameters, starting with $0.

-D

A list of all double-quoted strings preceded by $ is written to standard output. These are the strings that are subject to language translation when the current locale is not C or POSIX. This also turns on the -n option.

-i

Makes the shell an interactive shell. Ignores signals TERM, INT, and QUIT. With job control in effect, TTIN, TTOU, and TSTP are also ignored.

-l

Makes bash act as if it were invoked as a login shell.

-o option

Takes the same arguments as set -o (see “set Options”).

-O, +O shopt-option

shopt-option ...

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.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Bash Shell Scripting, 2nd Edition

Bash Shell Scripting, 2nd Edition

Sander van Vugt
Bash Cookbook

Bash Cookbook

Ron Brash, Ganesh Sanjiv Naik
bash Cookbook

bash Cookbook

Carl Albing, JP Vossen, Cameron Newham

Publisher Resources

ISBN: 9781491975329Errata Page