Full Download Linux Programming by Example The Fundamentals 1st Edition Robbins PDF DOCX
Full Download Linux Programming by Example The Fundamentals 1st Edition Robbins PDF DOCX
https://ebookfinal.com/download/access-2002-programming-by-
example-1st-edition-bob-villareal/
https://ebookfinal.com/download/your-wish-is-my-command-programming-
by-example-1st-edition-henry-lieberman/
https://ebookfinal.com/download/professional-linux-programming-1st-
edition-jon-masters/
https://ebookfinal.com/download/linux-system-programming-1st-edition-
robert-love/
Django By Example 1st Edition Antonio Melé
https://ebookfinal.com/download/django-by-example-1st-edition-antonio-
mele/
https://ebookfinal.com/download/version-control-by-example-1st-
edition-eric-sink/
https://ebookfinal.com/download/beginning-linux-programming-4th-
edition-neil-matthew/
https://ebookfinal.com/download/beginning-linux-programming-3rd-
edition-neil-matthew/
https://ebookfinal.com/download/sas-functions-by-example-second-
edition-ron-cody/
Linux Programming by Example The Fundamentals 1st
Edition Robbins Digital Instant Download
Author(s): Robbins, Arnold
ISBN(s): 9780131429642, 0131429647
Edition: 1
File Details: PDF, 3.31 MB
Year: 2004
Language: english
Linux Programming
by Example
Arnold Robbins
PRENTICE HALL
Professional Technical Reference
Upper Saddle River, NJ 07458
www.phptr.com
Prentice Hall
Open Source Software Development Series
Arnold Robbins, Series Editor
Open Source technology has revolutionized the computing world. Many large-scale projects are
in production use worldwide, such as Apache, MySQL, and Postgres, with programmers writing
applications in a variety of languages including Perl, Python, and PHP. These technologies are in
use on many different systems, ranging from proprietary systems, to Linux systems, to traditional
UNIX systems, to mainframes.
The Prentice Hall Open Source Software Development Series is designed to bring you the
best of these Open Source technologies. Not only will you learn how to use them for your
projects, but you will learn from them. By seeing real code from real applications, you will learn
the best practices of Open Source developers the world over.
Prentice Hall PTR offers discounts on this book when ordered in quantity for bulk purchases or special sales. For
more information, please contact: U.S. Corporate and Government Sales, 1-800-382-3419,
corpsales@pearsontechgroup.com. For sales outside of the United States, please contact: International Sales,
1-317-581-3793, international@pearsontechgroup.com.
Portions of Chapter 1, Copyright © 1994 Arnold David Robbins, first appeared in an article in Issue 16 of Linux
Journal, reprinted by permission.
Portions of the documentation for Valgrind, Copyright © 2003 Julian Seward, reprinted by permission.
Portions of the documentation for the DBUG library, by Fred N. Fish, reprinted by permission.
The GNU programs in this book are Copyright © 1985-2003, Free Software Foundation, Inc.. The full list of files
and copyright dates is provided in the Preface. Each program is “free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by the Free Software Foundation; either version
2 of the License, or (at your option) any later version.” Appendix C of this book provides the text of the GNU
General Public License.
All V7 Unix code and documentation are Copyright © Caldera International Inc. 2001-2002. All rights reserved.
They are reprinted here under the terms of the Caldera Ancient UNIX License, which is reproduced in full in
Appendix B.
Cover image courtesy of Parks Sabers, Inc. The Arc-Wave(tm) saber is manufactured by Parks Sabers, Inc., Copyright
© 2001, www.parksabers.com. Parks Sabers is not associated with any Lucasfilm Ltd. property, film, or franchise.
The programs and applications presented in this book have been included for their instructional value. They have
been tested with care but are not guaranteed for any particular purpose. The publisher does not offer any warranties
or representations, nor does it accept any liabilities with respect to the programs or applications. UNIX is a registered
trademark of The Open Group in the United States and other countries.
Microsoft, MS, and MS-DOS are registered trademarks, and Windows is a trademark of Microsoft Corporation in
the United States and other countries. Linux is a registered trademark of Linux Torvalds.
All company and product names mentioned herein are the trademarks or registered trademarks of their respective
owners.
This material may be distributed only subject to the terms and conditions set forth in the Open Publication License,
v1.0 or later (the latest version is presently available at http://www.opencontent.org/openpub/), with License
Option B.
Printed in the United States of America
ISBN 0-13-142964-7
Text printed on recycled paper
First printing
Pearson Education LTD.
Pearson Education Australia PTY, Limited
Pearson Education Singapore, Pte. Ltd.
Pearson Education North Asia Ltd.
Pearson Education Canada, Ltd.
Pearson Educación de Mexico, S.A. de C.V.
Pearson Education—Japan
Pearson Education Malaysia, Ptd. Ltd.
To my wife Miriam,
and my children,
Chana, Rivka, Nachum, and Malka.
Contents
v
vi Contents
Audience
This book is intended for the person who understands programming and is familiar
with the basics of C, at least on the level of The C Programming Language by Kernighan
and Ritchie. (Java programmers wishing to read this book should understand C pointers,
since C code makes heavy use of them.) The examples use both the 1990 version of
Standard C and Original C.
In particular, you should be familiar with all C operators, control-flow structures,
variable and pointer declarations and use, the string management functions, the use of
exit(), and the <stdio.h> suite of functions for file input/output.
You should understand the basic concepts of standard input, standard output, and
standard error and the fact that all C programs receive an array of character strings
representing invocation options and arguments. You should also be familiar with the
fundamental command-line tools, such as cd, cp, date, ln, ls, man (and info if you
xvii
xviii Preface
have it), rmdir, and rm, the use of long and short command-line options, environment
variables, and I/O redirection, including pipes.
We assume that you want to write programs that work not just under GNU/Linux
but across the range of Unix systems. To that end, we mark each interface as to its
availability (GLIBC systems only, or defined by POSIX, and so on), and portability
advice is included as an integral part of the text.
The programming taught here may be at a lower level than you’re used to; that’s
OK. The system calls are the fundamental building blocks for higher operations and
are thus low-level by nature. This in turn dictates our use of C: The APIs were designed
for use from C, and code that interfaces them to higher-level languages, such as C++
and Java, will necessarily be lower level in nature, and most likely, written in C. It may
help to remember that “low level” doesn’t mean “bad,” it just means “more challenging.”
We have purposely kept the list of topics short. We believe that it is intimidating to
try to learn “all there is to know” from a single book. Most readers prefer smaller, more
focused books, and the best Unix books are all written that way.
So, instead of a single giant tome, we plan several volumes: one on Interprocess
Communication (IPC) and networking, and another on software development and
code portability. We also have an eye toward possible additional volumes in a Linux
Preface xix
Programming by Example series that will cover topics such as thread programming and
GUI programming.
The APIs we cover include both system calls and library functions. Indeed, at the C
level, both appear as simple function calls. A system call is a direct request for system
services, such as reading or writing a file or creating a process. A library function, on the
other hand, runs at the user level, possibly never requesting any services from the oper-
ating system. System calls are documented in section 2 of the reference manual (viewable
online with the man command), and library functions are documented in section 3.
Our goal is to teach you the use of the Linux APIs by example: in particular, through
the use, wherever possible, of both original Unix source code and the GNU utilities.
Unfortunately, there aren’t as many self-contained examples as we thought there’d be.
Thus, we have written numerous small demonstration programs as well. We stress
programming principles: especially those aspects of GNU programming, such as “no
arbitrary limits,” that make the GNU utilities into exceptional programs.
The choice of everyday programs to study is deliberate. If you’ve been using
GNU/Linux for any length of time, you already understand what programs such as ls
and cp do; it then becomes easy to dive straight into how the programs work, without
having to spend a lot of time learning what they do.
Occasionally, we present both higher-level and lower-level ways of doing things.
Usually the higher-level standard interface is implemented in terms of the lower-level
interface or construct. We hope that such views of what’s “under the hood” will help
you understand how things work; for all the code you write, you should always use the
higher-level, standard interface.
Similarly, we sometimes introduce functions that provide certain functionality and
then recommend (with a provided reason) that these functions be avoided! The primary
reason for this approach is so that you’ll be able to recognize these functions when you
see them and thus understand the code using them. A well-rounded knowledge of a
topic requires understanding not just what you can do, but what you should and should
not do.
Finally, each chapter concludes with exercises. Some involve modifying or writing
code. Others are more in the category of “thought experiments” or “why do you
think …” We recommend that you do all of them—they will help cement your under-
standing of the material.
xx Preface
Standards
Throughout the book we refer to several different formal standards. A standard is a
document describing how something works. Formal standards exist for many things,
for example, the shape, placement, and meaning of the holes in the electrical outlet in
1 This famous statement was made at The International Workshop on Efficient Production of Large Programs in
Jablonna, Poland, August 10–14, 1970.
Preface xxi
your wall are defined by a formal standard so that all the power cords in your country
work in all the outlets.
So, too, formal standards for computing systems define how they are supposed to
work; this enables developers and users to know what to expect from their software and
enables them to complain to their vendor when software doesn’t work.
Of interest to us here are:
1. ISO/IEC International Standard 9899: Programming Languages — C, 1990.
The first formal standard for the C programming language.
2. ISO/IEC International Standard 9899: Programming Languages — C, Second
edition, 1999. The second (and current) formal standard for the C programming
language.
3. ISO/IEC International Standard 14882: Programming Languages — C++, 1998.
The first formal standard for the C++ programming language.
4. ISO/IEC International Standard 14882: Programming Languages — C++, 2003.
The second (and current) formal standard for the C++ programming language.
5. IEEE Standard 1003.1–2001: Standard for Information Technology — Portable
Operating System Interface (POSIX®). The current version of the POSIX stan-
dard; describes the behavior expected of Unix and Unix-like systems. This
edition covers both the system call and library interface, as seen by the C/C++
programmer, and the shell and utilities interface, seen by the user. It consists
of several volumes:
• Base Definitions. The definitions of terms, facilities, and header files.
• Base Definitions — Rationale. Explanations and rationale for the choice of
facilities that both are and are not included in the standard.
• System Interfaces. The system calls and library functions. POSIX terms them
all “functions.”
• Shell and Utilities. The shell language and utilities available for use with shell
programs and interactively.
Although language standards aren’t exciting reading, you may wish to consider pur-
chasing a copy of the C standard: It provides the final definition of the language. Copies
xxii Preface
can be purchased from ANSI2 and from ISO.3 (The PDF version of the C standard is
quite affordable.)
The POSIX standard can be ordered from The Open Group.4 By working through
their publications catalog to the items listed under “CAE Specifications,” you can find
individual pages for each part of the standard (named “C031” through “C034”). Each
one’s page provides free access to the online HTML version of the particular volume.
The POSIX standard is intended for implementation on both Unix and Unix-like
systems, as well as non-Unix systems. Thus, the base functionality it provides is a subset
of what Unix systems have. However, the POSIX standard also defines optional exten-
sions—additional functionality, for example, for threads or real-time support. Of most
importance to us is the X/Open System Interface (XSI) extension, which describes facilities
from historical Unix systems.
Throughout the book, we mark each API as to its availability: ISO C, POSIX, XSI,
GLIBC only, or nonstandard but commonly available.
2 http://www.ansi.org
3 http://www.iso.ch
4 http://www.opengroup.org
5 http://www.gnu.org
Preface xxiii
By using GNU programs, we want to meet both goals: show you well-written,
modern code from which you will learn how to write good code and how to use the
APIs well.
We believe that GNU software is better because it is free (in the sense of “freedom,”
not “free beer”). But it’s also recognized that GNU software is often technically better
than the corresponding Unix counterparts, and we devote space in Section 1.4, “Why
GNU Programs Are Better,” page 14, to explaining why.
A number of the GNU code examples come from gawk (GNU awk). The main
reason is that it’s a program with which we’re very familiar, and therefore it was easy
to pick examples from it. We don’t otherwise make any special claims about it.
Summary of Chapters
Driving a car is a holistic process that involves multiple simultaneous tasks. In many
ways, Linux programming is similar, requiring understanding of multiple aspects
of the API, such as file I/O, file metadata, directories, storage of time information,
and so on.
The first part of the book looks at enough of these individual items to enable studying
the first significant program, the V7 ls. Then we complete the discussion of files and
users by looking at file hierarchies and the way filesystems work and are used.
Chapter 1, “Introduction,” page 3,
describes the Unix and Linux file and process models, looks at the differences be-
tween Original C and 1990 Standard C, and provides an overview of the principles
that make GNU programs generally better than standard Unix programs.
Chapter 2, “Arguments, Options, and the Environment,” page 23,
describes how a C program accesses and processes command-line arguments and
options and explains how to work with the environment.
Chapter 3, “User-Level Memory Management,” page 51,
provides an overview of the different kinds of memory in use and available in a
running process. User-level memory management is central to every nontrivial
application, so it’s important to understand it early on.
xxiv Preface
The second part of the book deals with process creation and management, interprocess
communication with pipes and signals, user and group IDs, and additional general
programming interfaces. Next, the book first describes internationalization with GNU
gettext and then several advanced APIs.
We round the book off with a chapter on debugging, since (almost) no one gets
things right the first time, and we suggest a final project to cement your knowledge of
the APIs covered in this book.
Chapter 15, “Debugging,” page 567,
describes the basics of the GDB debugger, transmits as much of our programming
experience in this area as possible, and looks at several useful tools for doing dif-
ferent kinds of debugging.
Chapter 16, “A Project That Ties Everything Together,” page 641,
presents a significant programming project that makes use of just about everything
covered in the book.
Several appendices cover topics of interest, including the licenses for the source code
used in this book.
Appendix A, “Teach Yourself Programming in Ten Years,” page 649,
invokes the famous saying, “Rome wasn’t built in a day.” So too, Linux/Unix ex-
pertise and understanding only come with time and practice. To that end, we
have included this essay by Peter Norvig which we highly recommend.
Appendix B, “Caldera Ancient UNIX License,” page 655,
covers the Unix source code used in this book.
Appendix C, “GNU General Public License,” page 657,
covers the GNU source code used in this book.
xxvi Preface
Typographical Conventions
Like all books on computer-related topics, we use certain typographical conventions
to convey information. Definitions or first uses of terms appear in italics, like the word
“Definitions” at the beginning of this sentence. Italics are also used for emphasis, for
citations of other works, and for commentary in examples. Variable items such as argu-
ments or filenames, appear like this. Occasionally, we use a bold font when a point
needs to be made strongly.
Things that exist on a computer are in a constant-width font, such as filenames
(foo.c) and command names (ls, grep). Short snippets that you type are additionally
enclosed in single quotes: ‘ls -l *.c’.
$ and > are the Bourne shell primary and secondary prompts and are used to display
interactive examples. User input appears in a different font from regular computer
output in examples. Examples look like this:
$ ls -1 Look at files. Option is digit 1, not letter l
foo
bar
baz
We prefer the Bourne shell and its variants (ksh93, Bash) over the C shell; thus, all
our examples show only the Bourne shell. Be aware that quoting and line-continuation
rules are different in the C shell; if you use it, you’re on your own!6
When referring to functions in programs, we append an empty pair of parentheses
to the function’s name: printf(), strcpy(). When referring to a manual page (acces-
sible with the man command), we follow the standard Unix convention of writing the
command or function name in italics and the section in parentheses after it, in regular
type: awk(1), printf (3).
6 See the csh(1) and tcsh(1) manpages and the book Using csh & tcsh, by Paul DuBois, O’Reilly & Associates, Se-
bastopol, CA, USA, 1995. ISBN: 1-56592-132-1.
Preface xxvii
Unix Code
Archives of various “ancient” versions of Unix are maintained by The UNIX Heritage
Society (TUHS), http://www.tuhs.org.
Of most interest is that it is possible to browse the archive of old Unix source code
on the Web. Start with http://minnie.tuhs.org/UnixTree/. All the example code
in this book is from the Seventh Edition Research UNIX System, also known as “V7.”
The TUHS site is physically located in Australia, although there are mirrors of the
archive around the world—see http://www.tuhs.org/archive_sites.html.
This page also indicates that the archive is available for mirroring with rsync.
(See http://rsync.samba.org/ if you don’t have rsync: It’s standard on
GNU/Linux systems.)
You will need about 2–3 gigabytes of disk to copy the entire archive. To copy the
archive, create an empty directory, and in it, run the following commands:
mkdir Applications 4BSD PDP-11 PDP-11/Trees VAX Other
You may wish to omit copying the Trees directory, which contains extractions of
several versions of Unix, and occupies around 700 megabytes of disk.
You may also wish to consult the TUHS mailing list to see if anyone near you can
provide copies of the archive on CD-ROM, to avoid transferring so much data over
the Internet.
The folks at Southern Storm Software, Pty. Ltd., in Australia, have “modernized” a
portion of the V7 user-level code so that it can be compiled and run on current systems,
most notably GNU/Linux. This code can be downloaded from their web site.7
It’s interesting to note that V7 code does not contain any copyright or permission
notices in it. The authors wrote the code primarily for themselves and their research,
leaving the permission issues to AT&T’s corporate licensing department.
7 http://www.southern-storm.com.au/v7upgrade.html
xxviii Preface
GNU Code
If you’re using GNU/Linux, then your distribution will have come with source code,
presumably in whatever packaging format it uses (Red Hat RPM files, Debian DEB
files, Slackware .tar.gz files, etc.). Many of the examples in the book are from the
GNU Coreutils, version 5.0. Find the appropriate CD-ROM for your GNU/Linux
distribution, and use the appropriate tool to extract the code. Or follow the instructions
in the next few paragraphs to retrieve the code.
If you prefer to retrieve the files yourself from the GNU ftp site, you will find them
at ftp://ftp.gnu.org/gnu/coreutils/coreutils-5.0.tar.gz.
You can use the wget utility to retrieve the file:
$ wget ftp://ftp.gnu.org/gnu/coreutils/coreutils-5.0.tar.gz Retrieve the distribution
… lots of output here as file is retrieved …
Alternatively, you can use good old-fashioned ftp to retrieve the file:
$ ftp ftp.gnu.org Connect to GNU ftp site
Connected to ftp.gnu.org (199.232.41.7).
220 GNU FTP server ready.
Name (ftp.gnu.org:arnold): anonymous Use anonymous ftp
331 Please specify the password.
Password: Password does not echo on screen
230-If you have any problems with the GNU software or its downloading,
230-please refer your questions to <gnu@gnu.org>.
... Lots of verbiage deleted
230 Login successful. Have fun.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd /gnu/coreutils Change to Coreutils directory
250 Directory successfully changed.
ftp> bin
200 Switching to Binary mode.
ftp> hash Print # signs as progress indicators
Hash mark printing on (1024 bytes/hash mark).
ftp> get coreutils-5.0.tar.gz Retrieve file
local: coreutils-5.0.tar.gz remote: coreutils-5.0.tar.gz
227 Entering Passive Mode (199,232,41,7,86,107)
150 Opening BINARY mode data connection for coreutils-5.0.tar.gz (6020616 bytes)
#################################################################################
#################################################################################
...
226 File send OK.
6020616 bytes received in 2.03e+03 secs (2.9 Kbytes/sec)
ftp> quit Log off
221 Goodbye.
Preface xxix
In the hands of a Jedi Knight, a light saber is both a powerful weapon and a thing
of beauty. Its use demonstrates the power, knowledge, control of the Force, and arduous
training of the Jedi who wields it.
The elegance of the light saber mirrors the elegance of the original Unix API design.
There, too, the studied, precise use of the APIs and the Software Tools and GNU design
principles lead to today’s powerful, flexible, capable GNU/Linux system. This system
demonstrates the knowledge and understanding of the programmers who wrote all its
components.
And, of course, light sabers are just way cool!
Acknowledgments
Writing a book is lots of work, and doing it well requires help from many people.
Dr. Brian W. Kernighan, Dr. Doug McIlroy, Peter Memishian, and Peter van der
Linden reviewed the initial book proposal. David J. Agans, Fred Fish, Don Marti, Jim
Meyering, Peter Norvig, and Julian Seward provided reprint permission for various
items quoted throughout the book. Thanks to Geoff Collyer, Ulrich Drepper, Yosef
Gold, Dr. C.A.R. (Tony) Hoare, Dr. Manny Lehman, Jim Meyering, Dr. Dennis M.
Ritchie, Julian Seward, Henry Spencer, and Dr. Wladyslaw M. Turski, who provided
much useful general information. Thanks also to the other members of the GNITS
gang: Karl Berry, Akim DeMaille, Ulrich Drepper, Greg McGary, Jim Meyering,
François Pinard, and Tom Tromey, who all provided helpful feedback about good
programming practice. Karl Berry, Alper Ersoy, and Dr. Nelson H.F. Beebe provided
valuable technical help with the Texinfo and DocBook/XML toolchains.
Good technical reviewers not only make sure that an author gets his facts right, they
also ensure that he thinks carefully about his presentation. Dr. Nelson H.F. Beebe,
Geoff Collyer, Russ Cox, Ulrich Drepper, Randy Lechlitner, Dr. Brian W. Kernighan,
Peter Memishian, Jim Meyering, Chet Ramey, and Louis Taber acted as technical re-
viewers for the entire book. Dr. Michael Brennan provided helpful comments on
Chapter 15. Both the prose and many of the example programs benefited from their
reviews. I hereby thank all of them. As most authors usually say here, “Any remaining
errors are mine.”
I would especially like to thank Mark Taub of Pearson Education for initiating this
project, for his enthusiasm for the series, and for his help and advice as the book moved
xxxii Preface
through its various stages. Anthony Gemmellaro did a phenomenal job of realizing my
concept for the cover, and Gail Cocker’s interior design is beautiful. Faye Gemmellaro
made the production process enjoyable, instead of a chore. Dmitry Kirsanov and
Alina Kirsanova did the figures, page layout, and indexing; they were a pleasure to
work with.
Finally, my deepest gratitude and love to my wife, Miriam, for her support and en-
couragement during the book’s writing.
Arnold Robbins
Nof Ayalon
ISRAEL
I
1
This page intentionally left blank
1
Introduction
In this chapter
3
f there is one phrase that summarizes the primary GNU/Linux (and therefore
I Unix) concepts, it’s “files and processes.” In this chapter we review the Linux
file and process models. These are important to understand because the system calls
are almost all concerned with modifying some attribute or part of the state of a file
or a process.
Next, because we’ll be examining code in both styles, we briefly review the major
difference between 1990 Standard C and Original C. Finally, we discuss at some
length what makes GNU programs “better,” programming principles that we’ll see
in use in the code.
This chapter contains a number of intentional simplifications. The full details are
covered as we progress through the book. If you’re already a Linux wizard, please
forgive us.
4
1.1 The Linux/Unix File Model 5
record sizes, no indexed files, nothing. The interpretation of file contents is entirely up
to the application. (This isn’t quite true, as we’ll see shortly, but it’s close enough for
a start.)
Once you have a file, you can do three things with the file’s data: read them, write
them, or execute them.
Unix was designed for time-sharing minicomputers; this implies a multiuser environ-
ment from the get-go. Once there are multiple users, it must be possible to specify a
file’s permissions: Perhaps user jane is user fred’s boss, and jane doesn’t want fred
to read the latest performance evaluations.
For file permission purposes, users are classified into three distinct categories: user:
the owner of a file; group: the group of users associated with this file (discussed shortly);
and other: anybody else. For each of these categories, every file has separate read, write,
and execute permission bits associated with it, yielding a total of nine permission bits.
This shows up in the first field of the output of ‘ls -l’:
$ ls -l progex.texi
-rw-r--r-- 1 arnold devel 5614 Feb 24 18:02 progex.texi
Here, arnold and devel are the owner and group of progex.texi, and -rw-r--r--
are the file type and permissions. The first character is a dash for regular file, a d for
directories, or one of a small set of other characters for other kinds of files that aren’t
important at the moment. Each subsequent group of three characters represents read,
write, and execute permission for the owner, group, and “other,” respectively.
In this example, progex.texi is readable and writable by the owner, and readable
by the group and other. The dashes indicate absent permissions, thus the file is not ex-
ecutable by anyone, nor is it writable by the group or other.
The owner and group of a file are stored as numeric values known as the user ID
(UID) and group ID (GID); standard library functions that we present later in the book
make it possible to print the values as human-readable names.
A file’s owner can change the permission by using the chmod (change mode)
command. (As such, file permissions are sometimes referred to as the “file mode.”)
A file’s group can be changed with the chgrp (change group) and chown (change
owner) commands.1
1 Some systems allow regular users to change the ownership on their files to someone else, thus “giving them away.”
The details are standardized by POSIX but are a bit messy. Typical GNU/Linux configurations do not allow it.
6 Chapter 1 • Introduction
Group permissions were intended to support cooperative work: Although one person
in a group or department may own a particular file, perhaps everyone in that group
needs to be able to modify it. (Consider a collaborative marketing paper or data from
a survey.)
When the system goes to check a file access (usually upon opening a file), if the UID
of the process matches that of the file, the owner permissions apply. If those permissions
deny the operation (say, a write to a file with -r--rw-rw- permissions), the operation
fails; Unix and Linux do not proceed to test the group and other permissions.2 The
same is true if the UID is different but the GID matches; if the group permissions deny
the operation, it fails.
Unix and Linux support the notion of a superuser: a user with special privileges. This
user is known as root and has the UID of 0. root is allowed to do anything; all bets
are off, all doors are open, all drawers unlocked.3 (This can have significant security
implications, which we touch on throughout the book but do not cover exhaustively.)
Thus, even if a file is mode ----------, root can still read and write the file. (One
exception is that the file can’t be executed. But as root can add execute permission,
the restriction doesn’t prevent anything.)
The user/group/other, read/write/execute permissions model is simple, yet flexible
enough to cover most situations. Other, more powerful but more complicated, models
exist and are implemented on different systems, but none of them are well enough
standardized and broadly enough implemented to be worth discussing in a general-
purpose text like this one.
2 The owner can always change the permission, of course. Most users don’t disable write permission for themselves.
3 There are some rare exceptions to this rule, all of which are beyond the scope of this book.
1.1 The Linux/Unix File Model 7
page 83. They are also special in that the operating system dictates the format of direc-
tory entries.
Filenames may contain any valid 8-bit byte except the / (forward slash) character
and ASCII NUL, the character whose bits are all zero. Early Unix systems limited file-
names to 14 bytes; modern systems allow individual filenames to be up to 255 bytes.
The inode contains all the information about a file except its name: the type, owner,
group, permissions, size, modification and access times. It also stores the locations on
disk of the blocks containing the file’s data. All of these are data about the file, not the
file’s data itself, thus the term metadata.
Directory permissions have a slightly different meaning from those for file permissions.
Read permission means the ability to search the directory; that is, to look through it to
see what files it contains. Write permission is the ability to create and remove files in
the directory. Execute permission is the ability to go through a directory when opening
or otherwise accessing a contained file or subdirectory.
NOTE If you have write permission on a directory, you can remove files in that
directory, even if they don’t belong to you! When used interactively, the rm
command notices this, and asks you for confirmation in such a case.
The /tmp directory has write permission for everyone, but your files in /tmp
are quite safe because /tmp usually has the so-called sticky bit set on it:
$ ls -ld /tmp
drwxrwxrwt 11 root root 4096 May 15 17:11 /tmp
Note the t is the last position of the first field. On most directories this position
has an x in it. With the sticky bit set, only you, as the file’s owner, or root may
remove your files. (We discuss this in more detail in Section 11.5.2, “Directories
and the Sticky Bit,” page 414.)
Beyond all these was the frontier, with its own natural conditions,
type of inhabitants, and economic problems, a democratic
community separate from all the rest.
The Constitutional convention of 1787 in Philadelphia was typical
of this situation. Every problem found divergent interests and
63
opinions; every solution was effected by compromise. There was
state jealousy of all central authority; the opposition between large
and small states; that between the industries of the north and the
agriculture of the south; the slave trade, with its complex of moral
and economic problems; the sectionalism of the settled east and the
frontier west; the protection of the property-holding class and the
satisfaction of the radicals with their demand for liberty and equality.
Every one of these conflicts had to be settled if possible, or at least
(as with slavery) brought to a temporary status to avoid sharp
struggle. There were, of course, certain unifying factors. The
majority of the settlers were English, and most of these Protestants.
The non-English speaking elements were very largely of Teutonic
blood and Protestant religion also. There was a common political
experience, and a democratic urge typical of the frontier. Most
important of all, there was an eight-year war fought together against
a common enemy and under the same Commander-in-Chief. The
American government, then, with its new Constitution, was not a
simple unity from the outset. It was rather a highly complex unity,
containing within itself many minor groups, many different
viewpoints, and many integrations of the sub-group for the benefit
of the nation as a whole.
2.
An interesting illustration of this, and for our purpose a crucial
one, is in the religious life of the thirteen original states. Before the
Revolution, the states might be divided into four groups as regards
their religious organization: there were congregational
establishments in Massachusetts and Plymouth, New Haven,
Connecticut, and New Hampshire; Church of England establishments
in Virginia and the two Carolinas; four states formerly under various
regimes had had the Church of England forced on them—Maryland,
at first under Catholic rule, but with freedom of residence for all
Christians; New York and New Jersey, which had been dominated by
the Dutch Reformed Church; and Georgia, founded with almost
complete religious liberty. Only three states had no established
church—Rhode Island, Pennsylvania and its offshoot, Delaware. Of
these last, Rhode Island was founded by Roger Williams in 1636,
under the radical, not to say revolutionary principle of complete
separation of church and state, with right of residence and
citizenship for all persons, even including Jews and atheists.
Pennsylvania, chartered in 1681, was founded by William Penn, the
Quaker, with liberty of residence for all “believers in Almighty God”;
but the English government insisted on the condition that all voters
and office holders “shall be such as profess faith in Jesus Christ” and
the Protestant religion. What the new nation had, then, was not
religious liberty, but rather a clash of many different points of view.
64
Massachusetts set up its theocratic state with its chief interest in
the Church; Virginia established its civil state, with the church as a
subject member; while Rhode Island boldly denied the purposes and
premises of both, placing an impassable gulf between the State and
the Church and relegating to the individual conscience and to
voluntary association all concern and action touching the Church and
religious matters.
What, then, should be the upshot of this confusion of religious
groups, with their ancient hatreds and prejudices, ingrown with
history and overlaid with former strife and martyrdom? It was
obviously impossible to make the United States Calvinist or
Episcopal; it was necessary to have some sacrifice of each for the
good of all. But it might have been possible to make the nation
Protestant Christian, as was actually the case with the state of New
Hampshire until 1877. Various minor causes here entered in. Warfare
with England meant some opposition, at least, to the Church of
England. The distance from the actual seat of old-world struggles,
the character of the colonists and their longing for every type of
freedom, helped much. The new theories of the French
Encyclopedists, as adopted by Jefferson, certainly had great
influence. But most important of all was the existence of the many
minor sects, with the few important ones, of which all longed to rule
but none wished to be dominated by any other.
The upshot was religious freedom, the separation of church and
state, according to Article VI, Section 3, of the Federal Constitution:
“No religious test shall ever be required as a qualification to any
office or public trust under the United States.” This clause was
opposed on both sides—by Massachusetts as being too liberal, by
Virginia and Rhode Island as not liberal enough. Virginia had two
years before this overthrown her state church and given complete
freedom of conscience—not toleration—to all her people. The
opposition even to toleration was becoming crystallized in the words
of Thomas Paine: “Toleration is not the opposite of intolerance, but
the counterfeit of it. Both are despotisms: the one assumes to itself
the right of withholding liberty of conscience, the other of granting
it.” So the first amendment to the Constitution, adopted immediately
afterward by motion of the first Congress, and by the required two-
thirds of the states, was: “Congress shall make no law respecting an
establishment of religion, or prohibiting the free exercise thereof.”
This was tremendously significant of the growing and newly
conscious group mind of the United States of America. It was equally
important for the future of the nation and its unity in days to come.
Religious liberty was not a matter of doctrine in its inception; it was
the product of the birth and development of the group mind of the
nation. It meant the relinquishment of the racial habits, of the state
laws, of the old urge to persecute (common to almost every group,
even those who were themselves refugees from persecution), and
the adoption of a national standard to which every state, every
church and every sect should bring its sacrifice. And if this sacrifice
was not of their own right to live, but only of the right to make
others miserable, it was nevertheless the sacrifice of something so
important that the demand had convulsed France, Germany and
England not many years before. Religious liberty, indeed, however
firmly based on law and political ideals, never became the habit of
thought and action which intolerance had been. A recurrent
phenomenon of American life has been the breaking up into
religious, racial and sectional groups, with a further synthesis of
Americanization, through some common interest to unite them. The
conflict among the many groups prior to the adoption of the
Constitution, and its solution in that document with its Bill of Rights,
has been paralleled at least four times from that period to the
present day.
3.
These four reactions against the immigrant correspond with the
four peaks of the curve of immigration into the United States, with
two great alterations in the process, corresponding to the Civil War
and the World War.
Up till 1830, immigration into the United States was small in
amount and fairly regular. The first wave stretched from 1831 to
1861, reaching its peak in 1855; its total amounted to four millions
of foreigners, of whom the largest group and the first to come were
the Irish, the second in number and date of arrival the Germans.
The growth of intolerance against these newcomers was shown in
the movement known as Know-Nothingism or the American Party.
The second wave, of similar nationalities, was from 1862 to 1877;
the reply to this appeared in the anti-alien planks in the political
platforms of 1876. The third wave, from 1878 to 1897, was larger
than these earlier ones; it included many Scandinavians and, after
1882, growing numbers of Italians, Russians, and Austro-
Hungarians, the two last being composed in part of persecuted
Jews, in part of impoverished peasants. The Nativist reaction against
this immigrant trend appears rather in the form of religious
opposition, for the American Protective Association of those days
was predominantly anti-Catholic. The fourth wave began in 1898 and
extended until 1914, when the outbreak of the World War in Europe
caused a sudden drop to almost nothing; in its highest years, 1907
and 1913, more than 1,200,000 entered our ports annually; and the
greatest number of these new arrivals came from Italy, Austria-
Hungary and Russia. The reaction against these new immigrants was
under way, but the war interrupted its progress, and the Ku Klux
Klan arrived at its full power only after the war, when new conditions
swayed the group mind of America.
In each of these cases, the height of the movement against the
immigrant came just after the peak of the wave of immigration, at
the time when it had had time to impress itself on the native-born.
The philosophies of these four movements varied according to the
nationality of the immigrants against whom the natives were
protesting, and according to the general philosophy of life in vogue
at the time. The first such movement, the Know-Nothing or
American Party, originated in New York State in 1852 “as a secret
65
organization with passwords, oath, grip and ritual.” Its creed was
summed up in two words: Americanism and Protestantism. Its
special target was the two million Irish who had come into the
country; they were poor laborers, with a low standard of living,
ignorant, hereditary enemies of England, and Catholics into the
bargain. No wonder there were anti-Irish riots in New York,
Philadelphia and Boston; that it was rumored the Pope would soon
be dictator of America; or that the secret anti-alien society was
begun. But the course of the movement was spectacular and brief. It
entered national politics, thus both making bitter enemies for itself
and taking off the secrecy which was its chief source of power. Then
came the abolitionist movement, and the American party was split
into northern and southern branches. Most important of all, the peak
of immigration was passed, the Irish adopted the American standard
of living, became a part of communal life, without any danger of
Catholic overthrow of our cherished institutions—Othello’s
occupation was gone, and the Know-Nothing party disappeared.
The next wave of immigration and the next reaction against it
were minor ones. The immigrants met groups of their own origin
already absorbed into the common life of America, and fitted in with
little difficulty. The attempt in 1876 to prevent the use of public
funds for sectarian schools was itself comparatively slight.
But in between came the tremendous crisis of the Civil War. Here
the opposition was not between native and immigrant, but between
north and south, an industrial society of free laborers against an
agricultural society of castes,—planters, poor whites, and negro
slaves. I shall not go further into this conflict, because it is too
familiar and has comparatively little to do with the particular
application of my viewpoint. But, from our point of view, it is
important to see the place of the first Ku Klux Klan of 1865–71. This
was again a secret organization, adding the feature of disguise, for
the terrifying effect on the negroes whom it was the object of the
Klan to overawe. The Klan was a partisan and sectional organization,
of Southern white men of Confederate sympathies, to maintain their
group supremacy over the newly freed negroes and the “carpet
baggers” from the North. The victors had, as usual, indulged in
oppression over the losers, and the grievance was a very real one.
The Klan was partially successful in its object, but at once fell into
numerous abuses, was used by partisans to vent personal grudges,
fell into the hands of a lawless element, and was formally disbanded
in 1871 by General Nathan B. Forrest, its national commander or
Grand Wizard. Its slogan of “white supremacy” shows its animus
against the negroes and the North, not against the alien. Some of its
partisans claim that the Klan did not disband when it was formally
ordered so to do, but persisted in its underground activity until as
66
late as 1877. However that may be, its character and purpose are
very clear; it was sectional, timely, and for the one aim of white
supremacy. It appealed to its members and frightened its enemies
by its methods of disguise and secrecy, no less than by the beatings,
burnings and other outrages which were carried on either under its
auspices or by the false use of its insignia and methods. Its defiance
of the law imposed by force, and its use of force in reply, are the
vestiges of war psychology; It was the legitimate, if unlovely,
offspring of the Reconstruction. It had no function left when the
white South regained control of the states, but its memory still
lingers as part of the idealization of the “lost cause” of the
Confederacy.
The third reaction against immigration was primarily anti-Catholic
in trend. This was the A. P. A., or American Protective Association,
another secret society, organized in 1887, which reached its greatest
popularity in 1894 and 1895. At this same period there were several
other societies with the same purpose, notably the National League
for the Protection of American Institutions, which had a number of
extremely prominent men among its members. At this time the so-
called “new immigration” was growing strong, with its large numbers
of Italian and Austrian Catholics, added to those of German and Irish
origin already on the ground. The old fear of political domination by
the Papacy, expressed at the time of the adoption of the first
amendment to the Constitution, and then refuted, was again
revived. There was an orgy of purported “confessions” of nuns and
priests; there was circulated a forged oath of the Knights of
Columbus, in which the members agreed to place the papal
authority above their national allegiance; and a false encyclical of
Pope Leo XIII. Thousands of patriotic Americans believed all this
obvious nonsense, stirred up by the fear of a dominant Church; the
A. P. A. had as many as two million members and threatened to
drive out of public life the twelve million Catholics then in the
country, without regard to their race, nation, service to America, or
the number of generations they had lived in the United States. The
mob spirit, once aroused, crystalized in the breaking of the Northern
group mind of Civil War days into various sub-groups, Catholic, anti-
Catholic and indifferent. But the financial panic of the 1890’s resulted
in a sudden drop in immigration; the older settlers learned English
and were absorbed into the American cultural group; the A. P. A. had
no reason for existence, and again substantial unity was achieved by
the mind of the American people.
In this connection we must give a passing glance to what is still
our single greatest problem of groups, the existence of a ten per
cent. negro minority in the United States. These people were
brought here by force as slaves; as a subject class they were refused
education, though at the same time their own language, religion and
customs were thrown into disrepute and have been largely
forgotten. Though freed from economic slavery, they are still
politically a subject class in our southern states, while in northern
and border states they are gaining a political balance of power.
Finally, they rest everywhere under social disabilities, from the “Jim
Crow” cars of the South to the subtler distaste and ostracisms of the
North. The result is that they are forming complete, self-contained
Negro communities within the larger cities of the North and South
alike; that they are growing increasingly self-conscious as a group;
and that the large number of mulattoes, who in the British and
French West Indies would rank as a third group, between the racial
divisions, are here forced to make common cause with negroes. The
negroes are thus a self-conscious group, though their culture is
imitative. The grouping of the negroes apart is easy, on the whole,
because of the gross external signs, such as skin color and texture
of hair, so that the mass of the whites of the United States regard
them definitely as a different and a lower race. That anthropologists
are not so certain of all this makes little difference, because the
group mind is based rather on old habits of thought than on the
understanding of new and difficult facts. Here seems a problem of a
different order, then, than the racial and religious groupings of the
sub-varieties of the white race, which are constantly being overcome
and regrouped in a larger union of social life. In this study it will be
impossible to do more than point out the existence of this distinct
problem, with its similar mental background to the rest but its
immeasurably more terrible implications.
The fourth wave of immigration was by far the greatest in number
of newcomers, and by far the most variegated in racial and national
composition. It brought a million a year or more for six years during
this period. And its members had 75% of persons from southern and
eastern Europe, while the immigration prior to 1890 had included
only 20% of these races, and had been chiefly the English, Irish,
Germans and Scandinavians. It is no wonder that the race theory
began to be popular in America, under the spectacular leadership of
Lothrop Stoddard and Grant Madison, and that many began to
agitate for a greater or less limitation of the flood of immigration.
Even so sober a student of society as Professor Edward A. Ross of
Wisconsin held that it was wise to assimilate people of different
group mind more slowly than we were doing at the time. He said:
67
There have come among us in the last half century more than
twenty million European immigrants with all manner of mental
background, many of them having tradition which will no more blend
with American traditions than oil will blend with water.
And he proceeded to point out their inexperience with democratic
institutions, their lack of respect for law and for women, their
disbelief in progress. In addition, we need only note that many of
these people were Catholics and Jews; the total number of the
former in the United States in 1923 being estimated at 18,000,000
and of the latter at 3,600,000. And the Jews were far more
conspicuous than their numbers, on account of their massing in the
great cities and their concentration in certain lines of industry. Thus
the ground was fully prepared for a new anti-alien movement,
expressing itself this time in the form of efforts to restrict
immigration. This movement was under way in 1914, and would
probably have followed in the course of its precursors. But world-
shaking events ensued which altered the course of groups in
America as well. The outbreak of the World War in 1914, the
entrance of the United States into the war in 1917, altered all
groups, profoundly affected the American group mind, and made the
relation between the sub-groups and the mind of America very
different from what it had been. The results of this process are still
evident, and it is among them that we can look for anti-Semitism,
together with many other types of intolerance and group opposition.
CHAPTER V.
THE WORLD WAR AND ITS AFTERMATH
1.
With the outbreak of the World War in August 1914, the mind of
America suddenly became strikingly distinct from that of Europe.
They were fighting; we were watching. President Wilson appealed to
the United States to be “neutral in fact as in name ... impartial in
thought as well as in action.” The older American stock sympathized,
on the whole, with England, except for the Irish and Germans; the
newer immigrants had different racial and national affinities and
memories, some holding allegiance to their former governments,
some, like the oppressed Russian Jews, being especially bitter
against their former rulers. In this situation, American neutrality was
the result, not of indifference, but of lack of understanding on the
part of many groups in our population and of a stalemate between
the rest.
One definite result certainly was that all these diverse groups of
new and old immigrants began to feel themselves a unity, an
American people. They felt their distinction from the warring nations
overseas, their own interest, their own reaction to the complex
problems at issue. Meanwhile, however, both parties were trying
every means to bring the United States into the war on their own
sides. Germany tried to bring about an embargo on munitions sold
to the Allies and in default of that, to obstruct their shipment by
both peaceful and warlike means. Great Britain, more especially,
tried to influence American public opinion in favor of the Allies and
against Germany. Within, there were pacifists and advocates of
preparedness, both trying to mold opinion. This formation of an
American mind, and the difficulty of determining its future direction,
came to a head in the election of 1916, when the German-Americans
opposed President Wilson, and when Hughes was supported by
Roosevelt, the arch-interventionist. During this period we
experienced the first development of what we have since grown to
know intimately as “propaganda,” a deliberate, elaborate technique
for influencing the mind of the group.
The declaration of war by the United States in April, 1917, unified
the American mind in a manner and to a degree that were almost
inconceivable. Every immigrant group began to pass resolutions
favoring the government; the foreign language newspapers
commenced an intensive propaganda for the prosecution of the war.
Volunteers came from every section of the country and every type of
origin, as many from the children of Germans as from any other
group. The draft law was passed with apparent general approval;
and its enforcement met with surprisingly little difficulty. Huge loans
were made to the Allied governments. Tremendous bond issues were
raised by the American government, with general approval and the
coercion of any minority objectors. The National Council of Defense,
founded in August, 1916, was able in many cases to overcome the
dominant profit-motive of our society in gaining self-sacrificing
patriotism of manufacturers and merchants.
Along with this voluntary and spontaneous unification of the
group mind, came repression and coercion directed to forcing into
agreement any unabsorbed minority groups. The Committee on
Public Information was founded in September, 1917, to exert
propaganda through the sources of public information, to send out
favorable news and opinion, and even through censorship to
suppress material considered dangerous to the general cause. The
censorship exercised by the military forces on war bulletins, war
correspondents and the personal letters of soldiers, was applied less
strictly to the general population. The secret service, greatly
expanded to cope with German spies, began hunting out strikers,
radicals or any others who—in the minds of the detectives or of any
other government officials—might possibly obstruct the war efforts.
Emergency acts gave the President unusual power in these and
other directions.
This use of force was characteristic, not only of the government,
but of local groups as well. In one place a German sympathizer (real
or supposed) might be made to kiss the flag; in another a strike
leader might be lynched. In Milwaukee, where public opinion was
sensitive on account of the large number of German-Americans, a
quota of Liberty Bonds was assigned arbitrarily to every person, and
he was practically forced to purchase them, irrespective of his ability
to do so, by threats of ostracism, by influence of his creditors, by
every sort of social pressure,—in order that Milwaukee might rank as
a real American community and go “over the top” in every “drive.”
The military language applied to these campaigns was matched by a
growing technique of organization. Professional propagandists
perfected a method of meetings, songs, card-catalogs, and quotas,
by which any cause might be assured of huge sums of money. The
greater propaganda of our government and foreign governments
was matched by the little propaganda of every subgroup, as long as
this was not in conflict with the general purpose.
A striking illustration of this is in the successful drives of the
various war-work agencies, the Red Cross, American Library
Association, Young Men’s Christian Association, Jewish Welfare
Board, Knights of Columbus, and the rest; and especially in their
enormous joint campaign just after the signing of the armistice.
Every American felt that this joint campaign, first, would help the
soldiers and the common cause; and second, indicated by its
inclusiveness the complete unification of America. Along with this
general unification came the similar process in many of the
68
immigrant groups themselves. Professor Miller tells how this was
reflected in the Czecho-Slovak group in America, so that bitter
atheists united with Catholic priests on joint committees for national
freedom in their old home in Europe.
2.
This internal unification was accomplished by a high emotional
tension, a national and personal uncertainty, and a common hate.
The prejudice against the various immigrant groups, arising as a
result of the great wave of immigration, was abated for the moment;
all the little prejudices were summed up in one great hatred of the
common enemy, Germany. This was reflected in avoidance of
everything German in this country as well; German instruction was
withdrawn from many high schools, German music from the opera
houses, German fried potatoes from the restaurants. The term,
“German-American,” formerly in good repute, now became a
byword, and with it every form of “hyphen.” The demand now was
for “hundred per cent.” Americanism.
In the prevailing ignorance of foreign languages and peoples, or
even if this ignorance had not existed in its full measure, the hatred
against the Germans was transferred in part to other groups as well,
even those with most reason to be anti-German or anti-Austrian.
Foreign language newspapers fell under popular suspicion and
official censorship much heavier than that of the English language
periodicals. Some states passed laws, later declared unconstitutional,
forbidding teaching, preaching or public meetings in languages other
than English. Foreign sounding names attracted suspicion, and were
changed in large numbers. Altogether, America begun to repeat the
oppression of subject groups which had caused permanent
resentment and sown the seeds of rebellion in almost every land in
Europe, to create her own Ireland, Alsace-Lorraine or Poland.
Americanization became a synonym for compulsory adoption of
American standards and group habits.
Americanization had had a long, if somewhat unsatisfactory, trial
before the war. It was the attempt, at that time, to bring American
culture to the supposedly uncultured immigrant through settlements,
night schools, and other cultural agencies. The attempt was
satisfactory in a comparatively small proportion of the total
immigrant population; and the earnest workers blamed this fact on
the poorness of their textbooks, the unsuitability of their buildings,
or the weariness of the people after a day of arduous labor. Now, all
of these were undoubtedly true, but a more fundamental cause of
the weakness of Americanization methods lay in the fact that they
were all one-sided; they consisted in attempts to change the
immigrant into an American, rather than attempts to join many
groups together into a composite unity. Even the conference on
Americanization called by the Secretary of the Interior in 1918
passed friendly and practical resolutions, but still one-sided and
consequently superficial.
The few individuals who persisted in their individuality, who
refused to be absorbed in the group purpose, formed no clearly
marked group of themselves. They were the “conscientious
objectors,” who refused any type of activity that might help the
military machine; the “slackers,” who evaded the draft for selfish
reasons; various religious groups, such as the Quakers; a few
economic dissenters, such as the Industrial Workers of the World.
They received, as they must have expected, the violent disapproval
of the group, expressed in terms of mob attack, legal imprisonment,
or at least, extreme social disapproval. They were the unassimilated
residuum of personality in the general unification of the American
group under the pressure of an external foe.
3.
Then came the armistice in November, 1918. As Dr. Drachsler
remarks:
69
The war lasted long enough to make America painfully conscious
of her peculiar problem of nationalism, but was not of long enough
duration to fuse the divergent ethnic elements permanently.
The artificial unity of war-time had no longer a purpose, and began
instantly to dissolve into its component elements. But the high
emotional tone of the war-time remained. Men still hated violently,
but they could no longer release this hatred in battle or in sending
others to battle. The repressive agencies remained in existence and
in excellent running order; groups had learned how to use
propaganda as an instrument; the habit of group pressure on
subgroups and on different and opposing groups had been
strengthened. Most of all, great masses of Americans had a new
group consciousness of America as a group, with the uniformity of
habit, opinion and conduct characteristic of their own subgroup
taken as normal for the whole.
The first result, then, was that the original subgroups fell apart
and that their opposition was stronger and more open than before
the war. This was due certainly to the heightened emotional tone,
not only of the American mind, but every group mind the world over.
During the war men and nations lived habitually under conditions of
excitement, uncertainty and tension. After the war the same
emotional tone remained to color whatever group ideas might
become associated with its action. So the whites who had drafted
negroes to fight for them resented these same negroes coming
home with the new pride of soldiers, remembering new equality of
treatment they had received from the French. The daughters of the
rich no longer danced with the poor, ignorant farm boys as they had
in every cantonment. Prejudice against the uniform returned, and
girls of certain classes would no longer care to be seen with soldiers
or sailors; as they had when those men were expressing the group
purpose by their very garments. And the hatred of the various
immigrant groups for each other—the hatred of the older American
groups against the immigrant, the Catholic and the Jew, returned
with redoubled force. As the present writer found occasion to note
directly after the close of the war:
70
During the war we felt that prejudice between men of different
groups and different faiths was lessening day by day, that our
common enthusiasm in our common cause had brought Catholics,
Protestants and Jews nearer together on the basis of their ardent
Americanism. Especially we who were at the front felt this in the first
flush of our co-operation, our mutual interest and our mutual
helpfulness.
This disappointment was common to many of us who had allowed
our hopes to run beyond our knowledge.
Another cause of this unusual strength of group hatreds was the
very repression of the war period. Individuals and sub-groups had
sacrificed their prejudices for the common purpose, but they had
done so without pleasure and as a sacrifice. Now they resumed their
group intolerance with redoubled zest due to long repression,
whether that had been voluntary or forced. The “white, gentile,
Protestant American” may have resented fighting on an equality with
the negro, or under the orders of a foreigner—now that resentment
had its vent. Never has group feeling run higher in America than in
this reaction from the sudden, violent and partially artificial unity
during our participation in the World War.
One notable result of this sudden relaxation of unity, this sudden
predominance of the subgroups, appeared in the phenomena of
displacement. Displacement is a common matter among paranoiacs,
where one object is substituted for another with the same meaning
and the same feeling-tone of resentment or of pleasure. It is also a
common characteristic of mobs, which may be called for this and
other reasons, a sort of social paranoiacs; the lynching mob will turn
from its intended victim to hang instead a public official or a
71
bystander who objects even mildly to its program. In this way the
hatreds of war-time were displaced. The hatred for the German was
displaced to the alien as a whole. The hatred and suspicion of
Russia, aroused when that nation drew out of the war, and
intensified when it adopted the radical economic program of the
Bolsheviki and the novel political rule of the Soviets, was displaced
and applied to all economic radicals, whether Russian or American.
Finally, the Jew was identified as a foreigner (even though he might
be American-born and a veteran of the war); and as a radical (even
though he might be an ultra-conservative capitalist). The ancient,
lingering anti-Judaism and anti-Semitism of ages past appeared
again; the Jew was not only a Christ-killer or a boor or a Semite,—
for no accusation was ever entirely dropped—he was also an alien
and a radical, an international banker and an enemy of gentile
civilization.
CHAPTER VI.
THE KU KLUX KLAN AND OTHER GROUP
REACTIONS
The outstanding phenomenon of the post-war period was the Ku
Klux Klan. Other events which accompanied it were the new laws for
the limitation of immigration and the general suppression of civil
liberties of many kinds. The Klan had something to do with both of
these as cause and as effect. Moreover, all three—Klan, anti-alien
movement, anti-radical movement—were largely anti-Semitic in
sentiment; in addition to which there was a separate movement of
anti-Semitism based on the imported anti-Semitism from Europe.
Therefore in any study of anti-Semitism as a group reaction we must
also study these three group reactions of the post-war period, all of
them partially anti-Semitic, and all of them associated with the same
group-ideas and the same group-will as anti-Semitism itself.
1.
The Ku Klux Klan of the present is not the one of the
Reconstruction period in any sense. It has taken over the name, the
garb and much of the high-sounding ritual. But it has a new motive
and a new psychology. The old Klan was sectional; the new is
national. The old was anti-Northern and anti-negro; the new is anti-
alien, anti-negro, anti-Catholic and anti-Jewish. The old met a certain
emergency and was then disbanded by compulsion of the Federal
government and the action of its own leaders; the new has
expanded from the character of a fraternal society to that of a
nation-wide propaganda movement, has entered politics, and
become one of the leading political issues of the campaign of 1924.
In other words, its real ancestors are: not the Ku Klux Klan of the
south in 1866–71, but the Know-Nothing Party of the 50’s and the A.
P. A. of the 90’s.
The Ku Klux Klan was organized in 1915 in Atlanta, Ga., by
William J. Simmons, a former Protestant minister of strong
convictions, intense if narrow intellect, and great interest in the
organization and spreading of fraternal orders. For five years it grew
slowly and inconspicuously, during the period of the war and for two
years thereafter; in June 1920 it had about five thousand members
and was in financial straits. At this juncture it was taken up by Mr.
Edward Young Clarke and Mrs. Elizabeth Tyler, who had had
experience in the new technique of propaganda. Under their skilled
hands the Klan at once grew with astounding rapidity; paid
organizers entered state after state, organized “Klaverns,” and
reaped great profits for themselves and for the heads of the
organization. But the commercial motive, while probably strong in a
few persons, was in no sense important in the actual membership of
the Klan and their acts. “Its official documents indicate that the Klan
originally was a purely fraternal and patriotic organization, one of
72
the hundreds of similar secret societies throughout the country.”
The New York World investigated the Klan in 1921, and a
Congressional investigation followed in October of that year, but both
served rather to advertise than to harm the organization. It spread
rapidly throughout the Union, claiming at one time as many as four
million members, elected senators and governors in a few instances,
and in several became the outstanding issue of state elections,
sponsored or was accused of innumerable acts of mob violence,
ranging from warnings to certain persons to discontinue their
bootlegging or immorality, up to beatings, tar-and-feather parties,
and the notorious Mer Rouge murders of 1922 in Louisiana.
We have already discussed the expansion of propaganda, so that
its enormous utilization by the Klan is quite comprehensible. But
even the constant reiteration of laudable motives and grandiloquent
phrases about Americanism cannot account for this sudden rise to
power; two other elements must be included—group prejudice and
secrecy. The Klan capitalized every prejudice of its group, which was
predominantly a small-town one, of American birth, Protestant
religion, and Anglo-Saxon either in race or in their opinion of their
race. And the Klan met in utter secrecy, did not divulge the names of
its members, paraded the streets in the disguise of robes and masks,
and carried out its deeds of violence in the same awe-inspiring
anonymity.
Clearly, the Klan is typical of the tendencies we have found in the
American mind after the war. It represents a subgroup revolting
against its voluntary sacrifices for the nation during the war. It
represents the anti-alien, anti-Catholic and now also anti-Jewish
sentiment, the reaction against the enormous wave of immigration
just at an end. It includes also the fear and hatred of the negro,
strongest in the old South but spreading to the North with the
northern migration of many negroes during and after the war. On
the Pacific coast the fear of the Japanese immigration enters into the
complex of hatreds. In other words, the Klan is the third wave of
Nativism. It is the great reaction of the subgroup to the intense
sacrifice for the nation during the war.
2.
Various other motives are implicated in this general complex. The
South furnished the original soil of the Klan; its second center was
the middle west, the old home of the A. P. A. It was weakest on the
Atlantic and Pacific coasts (except Oregon) where the various
immigrant groups actually live. It was weak in the heterogeneous
masses of the cities with their aliens, Catholics and Jews; strongest
in the small town, where men may talk of the Papal menace without
actually knowing many Catholics, of the Elders of Zion without
seeing personally more than one or two Jews a year. The attitude of
Nativism, the reaction to the immigration of huge masses of
foreigners, is still strongest where these foreigners themselves are
not in evidence.
This suggests that other motives must enter in, that something
else in the small-town American must have made the Klan congenial.
That something else is monotony, standardization (the “Main Street”
attitude), and the appeal of the Klan to these people lay largely in its
glamor of mystery, secrecy and hidden power. The rise of fraternal
orders is one of the note-worthy movements in American life; there
are now over six hundred of these societies in the United States, of
which four hundred ninety were organized between 1880 and 1895.
Over seven per cent. of our population is affiliated with these orders,
and their greatest strength is precisely in the small town, where they
are a bright spot in the dull social life, and give a factitious
importance to their “nobles” and “exalted rulers,” as well as to the
many who are permitted to enter into their secrets and to parade in
73
their regalia. Professor Mecklin classifies secret societies in three
groups: the beneficial societies, with whom secrecy is merely
protective; the social organizations, devised to give “variety and
interest to our poverty-stricken American life”; and finally, militant
societies with a general program which affects the entire nation, like
the old Ku Klux Klan, the Mafia, and the Fenians. He concludes that
the present Klan, while undoubtedly furnishing for many of its
members the release from monotony, the sense of power, the revolt
against repression, that is characteristic of the second class of
organizations, has also the characteristics of the third type and is
therefore a public problem. As he points out elsewhere in his book,
the disguise of the mask is a further danger, as it may be adopted by
members to persecute non-members in nameless ways, and even
presents an opportunity for non-Klansmen to indulge in violence
practically without fear of detection.
Professor Mecklin’s analysis of Klan psychology in Chapter IV of
his book presents several suggestive points. He says:
74
The strength of the Klan lies in that large, well-meaning, but
more or less ignorant and unthinking middle class, whose inflexible
loyalty has preserved with uncritical fidelity the traditions of the
original American stock.
75
Membership in a vast mysterious Empire means a sort of mystic
glorification of his petty self.
The Klan insists on like-mindedness, in the sense of adopting the
Anglo-Saxon ideals as the norm for America. Finally,
76
The Klan has literally battened upon the irrational fear
psychology that followed on the heels of the war.
Father John A. Ryan contributes an additional motive,
77
There is a particular manifestation of public opinion which
deserves emphasis as a cause of the recent intolerance. This is the
conviction which seized large and numerous groups of individuals that
they were justified in becoming extra legal agents for law
enforcement.... Either the spirit or the letter of the law is violated in
the name of the law itself.
3.
A word may be needed especially on our narrower topic, the
relation of the Ku Klux Klan to the Jew. Its preliminary questions to
the candidate for “naturalization” include two that exclude the
Catholic, two the Jew, one the alien and one the negro. The most
inclusive is number 2: “Are you a native born, white, Gentile
American citizen?” Number 4 is: “Do you believe in the tenets of the
Christian religion?” Imperial Wizard H. W. Evans gave out an
interview in Indianapolis early in 1924 when he made the following
statement, repeated several time later in other connections:
By deliberate election he (the Jew) is unassimilable. He rejects
intermarriage. His religious and social rites and customs are inflexibly
segregative. Law-abiding, healthy, moral, mentally alert, energetic,
loyal and reverent in his home life, the Jew is yet by primal instinct a
Jew, indelibly marked by persecution, with no deep national
attachment, a stranger to the emotion of patriotism as the Anglo-
Saxon feels it. Klansmen have no quarrel with him, no hatred of him,
no thought of persecuting him. As Protestants are unavailable for
membership in all-Jewish societies, so Jews are unavailable for
membership in an all-Protestant society like the Klan. Moreover, their
jealously guarded separatism unfits them for co-operation in a
movement dedicated to the thorough unification of the dominant
strains in American life.
Here are the same themes of racial superiority, like-mindedness of
America, identification of Americanism and Protestantism. But
elsewhere we meet with direct attacks on the Jew, as on the
Catholic, negro and foreigner—not merely the assertion of their
inferiority. Speaking at Dallas, Texas, December 7, 1922, Mr. Evans
said:
The Jew produces nothing anywhere on the face of the earth. He
does not till the soil. He does not create or manufacture anything for
common use. He adds nothing to the sum of human welfare.
Everywhere he stands between the producer and the consumer and
sweats the toil of the one and the necessity of the other for his gains.
This sounds like an economic motive, but it may be merely repetition
of stock charges of traditional anti-Semitism. Mr. Bohn hints at such
an economic purpose when he remarks:
One factor has been the recent invasion of the smaller western and
southern towns by Jewish retail merchants. These are disliked and
opposed by their native American competitors for purely commercial
reasons.
These facts seem to me erroneous; there have always been Jewish
merchants and peddlers throughout the country, and they have
always had Christian competitors; probably they have merely been a
point of vantage for the aroused prejudices of the group. Dr. Mecklin
says:
82
The Klan insists, in the published statements of its ideals, upon
complete religious toleration while in actual practise it encourages
83
boycotts of Catholic and Jew in business and social relations. The
eternal quarrel of the Klan with the Jew and the Negro is that mental
and physical differences seem to have conspired to place them in
groups entirely to themselves.... The Negro is granted a place in
American society only upon his willingness to accept a subordinate
position. The Jew is tolerated largely because native Americanism
cannot help itself. The Jew is disliked because of the amazing tenacity
with which he resists absolute Americanization, a dislike that is not
unmingled with fear; the Negro is disliked, because he is considered
essentially an alien and unassimilable element in society.
4.
The Klan has now passed the zenith of its aggressiveness and its
influence. The campaign of exposure, while it made thousands of
members, also made thousands of enemies and robbed the Klan of
the secrecy which was so essential an element of its strength. Many
of its members lost interest, others were positively estranged by
certain methods and ideals of the organization. The trials for murder
at Mer Rouge, La., brought the Klan into bad odor generally. Most
important of all, the Klan went into politics, and in this followed
exactly the cycle of the Know-Nothings and A. P. A.’s—secrecy,
growth, propaganda, politics, enemies, decline. In 1924 the Klan
was an element in the national conventions of the two major parties.
The Republicans considered planks opposing and favoring the
organization and finally took no action. The Democrats had to take
up the issue because of the movement to nominate as their
presidential candidate Alfred E. Smith, governor of New York, and a
professing Catholic. While Mr. Smith had political supporters in his
own state of every religious denomination, still the entire strength of
the Klan was thrown against him. At the same time, the many Irish
Catholics belonging to the Democratic party resented the attempt of
the Klan to dictate the nomination and introduced a resolution
attacking the Klan by name. The conflict of that convention is now
historic, and resulted in thoroughly disorganizing the Democratic
party for the ensuing campaign.
Finally, the passage of the immigration bills of 1921 and 1924
robbed the Klan of its chief reason for existence, its most potent
argument. Immigration was abruptly cut down. Not only that, but its
national origin was totally altered so as to favor the peoples of
northern and western Europe, and to keep out the Italian Catholics
and Russian Jews. It is no longer possible to stimulate fear or hatred
on such a large scale again, now that immigration is no longer a
large factor in American life, and the group integration is once more
proceeding at its accustomed rate.
5.
The anti-immigration movement must not be regarded as a result
of the Klan but as a parallel phenomenon, with the same motives
and philosophy. The original political theory and economic situation,
by which all immigrants were welcomed into the United States to
help build up the country and to become full Americans has been
slowly altering. The first law of limitation, passed in 1882, and
followed up by later amendments, merely excluded convicts, persons
affected with contagious diseases, persons likely to become public
charges, and similar individuals for individual reasons. Other
legislation of economic trend excluded Chinese and later Japanese
laborers, and contract labor. In 1917 the demand to limit the
numbers of common labor, voiced by the American Federation of
Labor, met the desire to limit numbers and to select racial groups,
and the literacy test was embodied in the law, excluding all who
could not read or write in any language. But this was satisfactory to
neither the friends nor foes of immigration; it was merely a
temporary device.
In May 1921 a temporary law was passed limiting the number of
each nation to enter the United States annually to 3% of natives of
that nation residing here in 1910. This limited the total immigration
at once from the 1,285,349 of 1907, the peak year, to a total of
357,803. This total is in addition to immigrants from Canada, Mexico,
Newfoundland, Cuba and Central and South America; it does not
deduct the emigrants who often amount to as many or more than
those entering the country. It is simply a means of cutting down
numbers and altering proportions. It is directly a result of Klan
preachments, of Nordic theories, of the reaction of the native,
gentile, Protestant American to the growing complexity and
heterogeneity of the nation, and to the need of revising his mental
stereotypes of the United States. He must grow to think of his nation
as a nation of many elements, many beliefs, many backgrounds,
most of them different from his own—to him America is a Protestant
country, a white man’s country, a gentile country, and he intends
that it shall remain so.
Therefore the permanent immigration bill enacted in May, 1924,
changed the percentage from three to two, and the date on which
the quota is to be estimated from 1910 to 1890. The result of this
double change is to alter radically the racial and national composition
of the immigration stream and hence the total character of the
United States. As Chairman Albert Johnson of the House Committee
on Immigration, after whom the bill was named, phrased its double
purpose:
84
The committee took a very important step in recommending a
permanent percentage law and thus recognizing the principle that the
United States should never keep its doors wide open. Second, the
percentage is based on the census of 1890 instead of the census of
1910, as in the present law. The new measure thus aims to change
the character of our future immigration by cutting down the number
of aliens who can come from southern and eastern Europe. In other
words, it is recognized that, on the whole, northern and western
Europe furnish the best material for citizenship.
The total immigration, therefore, was reduced from 357,000 to
164,667 and the emigrants have to be deducted from this to
ascertain the actual annual increase. The Italian quota was reduced
from 42,000 to 3,845; the Russian from 24,000 to 2,200; the Polish
from 30,000 to 6,000. On the other hand, the German quota was
reduced only from 67,000 to 51,000; the Norwegian from 12,000 to
6,400; the British and Irish from 77,000 to 62,500. The bill carried
out radically the intentions of its sponsors, to cut down the flood of
immigration and to discriminate against the racial and religious
groups which they consider inferior because they appear externally
to be different. It is a group reaction of the same order and
motivation as the Ku Klux Klan.
6.
A concurrent phenomenon, arising from the same group mind but
essentially different in manifestation, is the suppression of civil
liberties which began during the war and continued afterward, an
expression of the same impulse toward compulsory like-mindedness,
but taking its criterion from the economic rather than the cultural,
religious or racial aspects of the differing groups. As Father Ryan put
it:
85
These deplorable phenomena are three-fourths due to war
legislation and surviving war hysteria and one-fourth due to industrial
factors.... By means of clever, unscrupulous and wholesale
propaganda, nine-tenths of the American people were led to believe
that the steel strike of 1919 was revolutionary, bolshevistic, and aimed
immediately at the overthrow of the government. As a matter of fact,
there was no more bolshevism in that contest than in any one of a
dozen important disputes that have occurred in the last ten years.
Attorney General Palmer asserted that there was an organized
attempt to overthrow the government of the United States sufficiently
widespread to merit the attention of Congress. As a matter of fact,
there was no such danger.
86
Dr. Harry F. Ward of Union Theological Seminary, in the same
Proceedings of the American Sociological Society, has a fine
summary of the “Repression of Civil Liberties in the United States
(1918–23).” He enumerates the new Supreme Court interpretation of
the free-speech clause of the first amendment to the Constitution,
by which a “clear and present danger” justifies its violation; the state
laws on syndicalism or sedition or anarchy; the attacks on the right
of labor to strike; the use of the Department of Justice of the United
States to repress radical economic movements; the mob violence
increasingly widespread and regular; and the national organizations
engaged in repression, such as the National Civic Federation, the
National Security League, and the Better American Federation.
The material is too wide in range and too full of important
instances to be even cursorily examined here. The trend, however,
was definitely a part of the post-war attitude of the American mind,
the breaking up into violently opposing groups, each claiming to
assert the true American spirit. The same attitude of repression
appears in the churches in the form of heresy trials and an
aggressive Fundamentalism. It appears in the form of legislative acts
to prohibit the teaching of evolution in the state universities of
several Southern states (most of which failed of passage). Dr. Ward
feels that the
Mob attacks, lynchings and prosecutions involving the use of free
speech reached their peak at the end of 1922, declining rapidly in.
1923. Interference with meetings by public authorities and private
groups reached a peak at the end of 1921, fell sharply in 1922, and
87
then went up again to a midway point in 1923.... We have a
manifest abatement of post-war repression, but that experience has
left us a heritage of repressive laws and ordinances and a technique
of administrative illegality all ready to be used on due occasion. It has
also strengthened our lynching habit of mind, with its determination
to enforce its type of goodness, and our traditional demand for
conformity already overstimulated by the increasing standardization of
life. The occasions for the use of those qualities and instruments of
repression are increasing rather than diminishing.
Attempts were made during the height of the anti-Russian and
anti-radical movement to connect Jews with Bolshevism in Russia
and with radicalism in the United States, so that this movement also
has its anti-Semitic phase. Thus anti-Semitism is bound up with the
Ku Klux Klan, with the immigration bills, with the economic
repression,—it is an integral part of the group reaction from national
unity, and appears in every phase of the post-war group reactions.
CHAPTER VII.
ANTI-SEMITISM
In “Loyalties” by John Galsworthy, there occur two statements of
anti-Semitism so powerful and so keen that they may serve as a key
to the whole situation. The young Jew has accused a Christian
aristocrat of stealing his purse. The gentile girl, naturally a liberal,
has to choose her loyalty. She says: “Oh! I know lots of splendid
Jews, and I rather like little Ferdie; but when it comes to the point—
they all stick together; why shouldn’t we! It’s in the blood....
Prejudices—or are they loyalties—I don’t know—criss-cross—we all
cut each other’s throats from the best of motives.” And later on an
English grocer of the lower middle class confesses: “To tell you the
truth, I don’t like—well, not to put too fine a point on it—‘ebrews.
They work harder; they’re more sober; they’re honest; and they’re
everywhere. I’ve nothing against them, but the fact is—they get on
so.”
1.
Anti-Semitism is, then, a typical because a violent group attitude.
In America in its newest manifestation it is a part of the complex of
group revolts after the World War; it is intimately associated with the
Ku Klux Klan, anti-immigration movement, and repression generally,
at the same time that it has distinctive phases of its own. As Lewis
S. Gannett wrote:
88
Because anti-Semitism is world-wide it is easy to assume that
it has the same causes everywhere; but conditions in America are
very different from conditions in countries where religion is taught in
the schools, where the Jews are virtually all middlemen, where the
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookfinal.com