(Ebook) Mastering Linux Shell Scripting, Second Edition by Mokhtar Ebrahim, Andrew Mallett ISBN 9781788990554, 1788990552 Download
(Ebook) Mastering Linux Shell Scripting, Second Edition by Mokhtar Ebrahim, Andrew Mallett ISBN 9781788990554, 1788990552 Download
https://ebooknice.com/product/mastering-linux-shell-scripting-
second-edition-42970142
(Ebook) Mastering Linux Shell Scripting, Second Edition by Mokhtar Ebrahim, Andrew
Mallett ISBN 9781788990554, 1788990552
https://ebooknice.com/product/mastering-linux-shell-scripting-second-
edition-42970140
ebooknice.com
(Ebook) Mastering Linux Shell Scripting, Second Edition by Mokhtar Ebrahim, Andrew
Mallett ISBN 9781788990554, 1788990552
https://ebooknice.com/product/mastering-linux-shell-scripting-second-
edition-42970142
ebooknice.com
https://ebooknice.com/product/mastering-linux-shell-scripting-a-practical-guide-
to-linux-command-line-bash-scripting-and-shell-programming-11381866
ebooknice.com
(Ebook) Mastering Linux shell scripting a practical guide to Linux command- line,
Bash scripting, and Shell programming by Mokhtar Ebrahim; Andrew Mallett ISBN
9781788990158, 1788990153
https://ebooknice.com/product/mastering-linux-shell-scripting-a-practical-guide-
to-linux-command-line-bash-scripting-and-shell-programming-11145962
ebooknice.com
(Ebook) Biota Grow 2C gather 2C cook by Loucas, Jason; Viles, James ISBN
9781459699816, 9781743365571, 9781925268492, 1459699815, 1743365578, 1925268497
https://ebooknice.com/product/biota-grow-2c-gather-2c-cook-6661374
ebooknice.com
(Ebook) Matematik 5000+ Kurs 2c Lärobok by Lena Alfredsson, Hans Heikne, Sanna
Bodemyr ISBN 9789127456600, 9127456609
https://ebooknice.com/product/matematik-5000-kurs-2c-larobok-23848312
ebooknice.com
(Ebook) SAT II Success MATH 1C and 2C 2002 (Peterson's SAT II Success) by Peterson's
ISBN 9780768906677, 0768906679
https://ebooknice.com/product/sat-ii-success-math-1c-and-2c-2002-peterson-s-sat-
ii-success-1722018
ebooknice.com
(Ebook) Linux Shell Scripting Cookbook, Second Edition by Shantanu Tushar, Sarath
Lakshman ISBN 9781782162742, 1782162747
https://ebooknice.com/product/linux-shell-scripting-cookbook-second-
edition-4450624
ebooknice.com
(Ebook) Cambridge IGCSE and O Level History Workbook 2C - Depth Study: the United
States, 1919-41 2nd Edition by Benjamin Harrison ISBN 9781398375147, 9781398375048,
1398375144, 1398375047
https://ebooknice.com/product/cambridge-igcse-and-o-level-history-
workbook-2c-depth-study-the-united-states-1919-41-2nd-edition-53538044
ebooknice.com
Mastering Linux Shell Scripting
Second Edition
Mokhtar Ebrahim
Andrew Mallett
BIRMINGHAM - MUMBAI
Mastering Linux Shell
Scripting Second Edition
Copyright © 2018 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any
form or by any means, without the prior written permission of the publisher, except in the case of brief
quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information
presented. However, the information contained in this book is sold without warranty, either express or implied.
Neither the authors, nor Packt Publishing or its dealers and distributors, will be held liable for any damages
caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products
mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the
accuracy of this information.
ISBN 978-1-78899-055-4
www.packtpub.com
mapt.io
Mapt is an online digital library that gives you full access to over
5,000 books and videos, as well as industry leading tools to help you
plan your personal development and advance your career. For more
information, please visit our website.
Why subscribe?
Spend less time learning and more time coding with practical
eBooks and Videos from over 4,000 industry professionals
Improve your learning with Skill Plans built especially for you
developers and tech professionals, just like you, to help them share
their insight with the global tech community. You can make a
general application, apply for a specific hot topic that we are
recruiting an author for, or submit your own idea.
Table of Contents
Title Page
Packt Upsell
Why subscribe?
PacktPub.com
Contributors
Conventions used
Get in touch
Reviews
Technical requirements
Command PATH
Configuring vim
Configuring nano
Configuring gedit
Hello Dolly!
Declaring variables
User-defined variables
Environment variables
Variable scope
Command substitution
Summary
Questions
Further reading
Technical requirements
Script comments
Try to be standard
Enhancing learning with simple scripts
Further reading
3. Conditions Attached
Technical requirements
Simple decision paths using command-line lists
Testing strings
Testing integers
Checking strings
Checking files and directories
Checking numbers
Combining tests
Summary
Questions
Further reading
4. Creating Code Snippets
Technical requirements
Abbreviations
Questions
Further reading
5. Alternative Syntax
Technical requirement
Recapping the test command
Testing files
Adding logic
Square brackets as not seen before
Setting defaults
When in doubt – quote!
Advanced tests using [[
White space
Summary
Questions
Further reading
6. Iterating with Loops
Technical requirement
for loops
Advanced for loops
The IFS
Summary
Questions
Further reading
7. Creating Building Blocks with Functions
Technical requirements
Introducing functions
Passing parameters to functions
Passing arrays
Variable scope
Returning values from functions
Recursive functions
Limiting substitution
Editing the file
Other sed commands
The delete command
Summary
Questions
Further reading
9. Automating Apache Virtual Hosts
Technical requirements
Apache name-based Virtual Hosts
Creating the virtual host template
First steps
Isolating lines
sed script files
Automating virtual host creation
Prompting for data during site creation
Summary
Questions
Further reading
10. AWK Fundamentals
Technical requirements
The history behind AWK
Displaying and filtering content from files
AWK variables
User-defined variables
Conditional statements
The if command
while loops
for loops
Formatting output
Further filtering to display users by UID
AWK control files
Built-in functions
Summary
Questions
Further reading
Anchor characters
The dot character
The character class
Ranges of characters
Using grep
Summary
Questions
Further reading
12. Summarizing Logs with AWK
Technical requirements
Resources hits
Identify image hotlinking
Summary
Questions
Further reading
Summary
Questions
Further reading
What is Python?
Supplying arguments
Counting arguments
Significant whitespace
String manipulation
Summary
Questions
Further reading
Assessments
Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
Chapter 8
Chapter 9
Chapter 10
Chapter 11
Chapter 12
Chapter 13
Chapter 14
Following this, you will learn how to define a variable and the
visibility of a variable. After this, you will learn how to store
command execution output into a variable, which is called command
substitution. Also, you will learn how to debug your code using bash
options and Visual Studio Code. You will learn how to make your
bash script interactive to the user by accepting input from the user
using the read command. Then, you will learn how to read options
and its values if the user passed them to the script. Following this,
you will learn how to write conditional statements such as if
statements and how to use case statements. After this, you will
learn how to create code snippets using vim and Visual Studio Code.
For repetitive tasks, you will see how to write for loops, how to
iterate over simple values, and how to iterate over directory content.
Also, you will learn how to write nested loops. Along with this, you
will write while and until loops. Then, we will move on to functions,
the reusable chunks of code. You will learn how to write functions
and how to use them. After this, you will be introduced to one of the
best tools in Linux, which is Stream Editor. As we are still talking
about text processing, we will introduce AWK, one of the best text
processing tools in Linux that you will ever see.
After this, you will learn how to empower your text processing skills
by writing better regular expressions. Finally, you will be introduced
to Python as an alternative to bash scripting.
Who this book is for
This book targets system administrators and developers who would
like to write a better shell script to automate their work. Some
programming experience is preferable. If you don't have any
background in shell scripting, no problem, the book will discuss
everything from the beginning.
What this book covers
, The What and Why of Scripting with Bash, will introduce
Chapter 1
Linux shells, how to write your first shell script, how to prepare your
editor, how to debug your shell script, and some basic bash
programming, such as declaring variables, variable scope, and
command substitution.
the user using read command, how to pass options to your script,
how to control the visibility of the entered text, and how to limit the
number of entered characters.
Chapter 6, Iterating with Loops, will teach you how to use for loops,
while loops, and until loops to iterate over simple values and complex
values.
engines, and how to use them with sed and AWK to empower your
script.
Chapter 12, Summarizing Logs with AWK, will show how to process the
httpd.conf Apache log file using AWK and extract useful well-formatted
data.
, A Better lastlog with AWK, will show you how to use AWK
Chapter 13
You should know some Linux basics such as the basic commands
such as ls, cd, and which.
Download the example code
files
You can download the example code files for this book from your
account at www.packtpub.com. If you purchased this book elsewhere, you
can visit www.packtpub.com/support and register to have the files emailed
directly to you.
Once the file is downloaded, please make sure that you unzip or
extract the folder using the latest version of:
The code bundle for the book is also hosted on GitHub at https://githu
b.com/PacktPublishing/Mastering-Linux-Shell-Scripting-Second-Edition. In case
We also have other code bundles from our rich catalog of books and
videos available at https://github.com/PacktPublishing/. Check them out!
Download the color images
We also provide a PDF file that has color images of the
screenshots/diagrams used in this book. You can download it from ht
tps://www.packtpub.com/sites/default/files/downloads/MasteringLinuxShellScriptingSec
ondEdition_ColorImages.pdf .
Conventions used
There are a number of text conventions used throughout this book.
Piracy: If you come across any illegal copies of our works in any
form on the Internet, we would be grateful if you would provide us
with the location address or website name. Please contact us at
[email protected] with a link to the material.
Like in any other scripting language, variables are the basic blocks of
coding. You will learn how to declare variables such as integers,
strings, and arrays. Furthermore, you will learn how to export these
variables and extend their scope outside the running process.
Finally, you will see how to visually debug your code using Visual
Studio Code.
You can use VS Code as an editor instead of vim and nano; it's up to
you.
Install bashdb, which is a required package for the bash debug plugin.
If you are using a Red Hat-based distribution, you can install it like
this:
$ sudo yum install bashdb
Install the plugin for VS Code, called bash debug, from https://marketpl
ace.visualstudio.com/items?itemName=rogalmic.bash-debug. This plugin will be
https://github.com/PacktPublishing/Mastering-Linux-Shell-Scripting-Second-Edition/tr
ee/master/Chapter01
Types of Linux shells
As you know, Linux consists of some major parts, such as the kernel,
the shell, and the GUI interface (Gnome, KDE, and so on).
The shell translates your commands and sends them to the system.
Most Linux distributions are shipped with many shells.
Every shell has its own features, and some of them are very popular
among developers today. These are some of the popular ones:
Now we know the types of shells and we know that we are going to
use bash, so what is bash scripting?
What is bash scripting?
The basic idea of bash scripting is to execute multiple commands to
automate a specific job.
As you might know, you can run multiple commands from the shell
by separating them with semi colons (;):
ls ; pwd
You can say that the shell is the glue that binds these commands
together.
The bash command hierarchy
When working on the bash shell and when you are sitting
comfortably at your prompt eagerly waiting to type a command, you
will most likely feel that it is a simple matter of typing and hitting the
Enter key. You should know better than to think this, as things are
never quite as simple as we imagine.
Command type
For example, if we type and enter ls to list files, it is reasonable to
think that we were running the command. It is possible, but we
often will be running an alias. Aliases exist in memory as a shortcut
to commands or commands with options; these aliases are used
before we even check for the file. Bash's built-in type command can
come to our aid here. The type command will display the type of
command for a given word entered at the command line. The types
of command are listed as follows:
Alias
Function
Shell built-in
Keyword
File
We can extend this further to display all the matches for the given
command:
$ type -a ls
ls is aliased to 'ls --color=auto'
ls is /bin/ls
If we need to just type in the output, we can use the -t option. This
is useful when we need to test the command type from within a
script and only need the type to be returned. This excludes any
superfluous information, and thus makes it easier for us humans to
read. Consider the following command and output:
$ type -t ls
alias
The output is clear and simple, and is just what a computer or script
requires.
The built-in type can also be used to identify shell keywords such as
if, and case. The following command shows type being used against
You can also see that the function definition is printed when we
stumble across a function when using type.
Command PATH
Linux will check for executables in the PATH environment only when
the full or relative path to the program is supplied. In general, the
current directory is not searched unless it is in the PATH. It is possible
to include our current directory within the PATH by adding the
directory to the PATH variable. This is shown in the following
command example:
$ export PATH=$PATH:.
This appends the current directory to the value of the PATH variable;
each item in the PATH is separated using a colon. Now your PATH has
been updated to include the current working directory and, each
time you change directories, the scripts can be executed easily. In
general, organizing scripts into a structured directory hierarchy is
probably a great idea. Consider creating a subdirectory called bin
within your home directory and add the scripts into that folder.
Adding $HOME/bin to your PATH variable will enable you to find the scripts
by name and without the file path.
Also, we will use Visual Studio Code as a modern GUI editor to edit
and debug our scripts.
searched for
set autoindent: We indent our code often; this allows us to return
to the last indent level rather than the start of a new line on
each line break
set tabstop=4: Sets a tab to be four spaces
When these options are set, the $HOME/.vimrc file should look similar to
this:
set showmode
set nohlsearch
set autoindent
set tabstop=4
set expandtab
syntax on
Configuring nano
The nano text editor is increasing in importance and it is the default
editor in many systems. Personally, I don't like the navigation or the
lack of navigation features that it has. It can be customized in the
same way as vim. This time, we will edit the $HOME/.nanorc file. Your
edited file should look something like the following:
set autoindent
set tabsize 4
include /usr/share/nano/sh.nanorc
Janet never knew how these dark passages were got through. She was
herself enfolded, carried away in the burden of the helpless woman who
leaned upon her guidance for every step. Their progress was wildly devious
and uneven, every step being a sort of falling forward, which nevertheless
carried them on with spasmodic rapidity, though terrible effort. The voices
and steps in front of them grew audible again, but before they reached the
last door, which stood open with curtains drawn aside, disclosing a warm
blaze of light, there arose a sudden tumult, a roar as of some wild creature,
with answering cries of panic and dismay. The opened doorway suddenly
darkened with a crowd of retreating figures, and Julia darted out from the
midst and came blindly flying upon the tottering group that was struggling
forward.
“Go back, go back!” cried Julia, “whoever you are. There’s a madman
there!” and then she gave a shriek as wild as the sounds that came from the
room, “Oh,” cried the girl, her shrill voice dominating even that riot, “it’s
mamma! My mother’s here!”
CHAPTER XLII.
Next moment they had surged as on the top of a wave to the room
within. Nothing could be more strange than the scene presented there. The
room was curtained all round with red, hung above a man’s height with
ruddy thick folds, upon which the firelight threw a still warmer flicker. A
shaded lamp filled it with softened light, and from above, from what
seemed a large skylight, a white stream of moonlight fell in, making a
curious disturbing effect in the warm artificial light. These accessories,
however, though they told afterwards, were as nothing to the sight that burst
upon the eyes of the new-comers. In the centre of the room stood a tall old
man, with a long pallid face, straggling white hair, and a white beard. His
face was distorted with excitement, his voice bellowing forth a succession
of cries, or rather roars, like the roars of a wild animal. His loose lips gave
forth these utterances with flying foam and a sort of mechanical rapidity:
“I know what you’ve come for? I can pay up! I can pay up! I’ve plenty
of money, and I can pay up! But I won’t be taken, not if it costs me my
life!”
These were the words that finally emancipated themselves from the
stammering utterance and became clear.
Vicars stood behind this wild figure holding both his arms, but it was
only by glimpses that the smaller man was visible holding the other as in a
vise.
“Come, sir, come, sir, no more of this; they’ll take you for a fool,” he
said.
And then this King Lear resumed. The foam flew from his lips; his great
voice came out in its wild bellowing, the very voice which Janet had heard
so often. It had seemed to her to utter but an inarticulate cry, but this, it
would seem, was what it had been saying all the time—words in which
there was some meaning—though what that meaning was, or whether the
speaker himself understood it, who would say?
The policeman and his attendant had edged towards the doorway, and
stood there huddled upon one another. The leader of the search had been
willing to face a revolver, but the madman was a thing for which he was not
prepared. He stood against the doorway ready to retreat still further in case
there should be any further advance. Meredith and Gussy had passed into
the room, and stood together, she very anxious, he very eager, at the side,
where those wild eyes had not caught them. Behind was Dolff very pale,
standing half concealed by the group formed by the madman and his
attendant, raising his head to look over them to the two in the doorway who
had come to look for him, and had received so unexpected a check.
Mrs. Harwood stumbled into the midst of this strange scene with her
tottering uncertain stride, driving Janet with her. She put up her hand to
hold back the dreadful insane figure. She was at one of the moments in life
when one is afraid of nothing, shrinks from nothing.
“Take him back to his seat, Vicars,” she said, “take him back.
Adolphus!” The tottering, helpless woman stood up straight, and put her
hand upon the madman’s breast. The eyes that had been blind with misery
changed and dissolved as if to dew in their orbits, consolidated again,
opened blue and strong like a relighted flame. She fixed them upon the
staring red eyes of the maniac. “Adolphus, go back, be silent, calm yourself.
There is no need for you to say anything. I am here to take care of you. Let
Vicars put you back in your chair.”
“I will not be taken,” he said, “I will not be taken! I can pay up. I have
got money, plenty of money. I will pay up!”
“Vicars,” cried Mrs. Harwood, imperiously, “put him back in his chair.”
She held her hand on his breast, and fixed her eyes upon his, pushing
him softly back. The roarings grew fainter, fell into a kind of whimpering
cry.
“I’ll pay it all—I have plenty of money. Don’t let them take me away—
I’ll pay everything up!”
“Go back and rest in your chair, Adolphus. Put him in his chair.”
The astonished spectators all stood looking on while the old servant and
this woman, whom force of necessity had moved from her own
helplessness, subdued the maniac. Vicars had partially lost his head, he had
lost control of his patient, but this unlooked-for help restored him to
himself. Between them they drew and guided the patient back to the chair,
which was fitted with some mechanical appliances, and held him fast. Mrs.
Harwood seemed to forget her weakness entirely; she tottered no longer, but
moved with a free step. She turned round upon the frightened policeman at
the door.
“Now go,” she said, “you have done your worst; whatever you want, go;
you can get no further satisfaction here.”
The intruder breathed more freely when he saw the madman sink into
quietude. He said, with a voice that quivered slightly.
“I am very willing to go: but that young gentleman has to go along with
me!”
“Come on,” cried the other man, whose teeth were chattering in his head.
“Come on; we’ve got nothing to do here.”
“I’m going: when that young gentleman makes up his mind to come with
me.”
“What young gentleman? Why, bless you, that ain’t the young
gentleman!” said the man, who had struggled out into the passage, and was
now only kept from running by the other’s strong retaining grasp.
It was not wonderful that the policeman was indignant. He let his friend
go with an oath, and with a sudden push which precipitated him into the
outer room.
“You d——d fool! to have led me such a dance; and as much as our lives
are worth, and come to nothing at the end.”
The man fell backward, but got up again in a moment and took to his
heels, with the noise as of a runaway horse in the dark passage. The
policeman, reassured to see that the madman was secured, had the courage
to linger a moment. He turned to Meredith with a defiant look.
“It has come to nothing, sir, and I ask your pardon that I’ve been led into
giving you this trouble by an ass. But I make bold to ask is this house
licensed? and what right has anyone got to keep a dangerous madman in it
without inspection, or any eye over ’im? I’ll have to report it to my
superior.”
“Report it to the—devil, and be off with you,” Meredith said.
The party stood round, staring into each other’s faces, when the strangers
thus withdrew. The madman struggled against the fastenings that secured
him.
“Julia,” he said, “don’t let them take me!” He tried to get hold of her
with his hands, feeling for her as if he did not see, and began to cry feebly,
in a childish, broken voice, “Don’t let them take me! I have got enough to
pay everybody. I kept it for you and the children. It was for you and the
children; but I’ll pay up, I’ll pay everybody; only don’t let them take me,
don’t let them take me!” he whimpered, tears—piteous, childish tears—
suffusing the venerable face.
“Oh,” cried Gussy, “don’t let him cry; for God’s sake don’t let him cry! I
cannot bear it—I cannot bear it—it is too much.”
“I’ll never complain any more,” said the patient; “I’m very comfortable,
I don’t want for anything. You shall pay them all up yourself if you don’t
believe me. I’ll give you the money—only don’t let them send me away!
I’ve got it all safe here,” he said. “Stop a moment, I’ll give it you: and all
these ladies and gentlemen can prove it, that I gave it you to pay up.” He
struggled to get his arms free, trying to reach his breast-pocket with one
hand. “Vicars, get it out, and give it to your mistress. The money—the
money, you know, to pay everybody up. Only,” he cried, putting the piteous
hands together which were held fast and could do so little, “don’t, Julia—
don’t let them take me away!”
“Oh, mamma,” cried Gussy, “I can’t bear it—I can’t bear it.”
She fell on her knees and covered her face.
“Who is he?” said Dolff. They had all of them, and even Dolff himself,
forgotten what was the cause of this revelation. The young man came
forward, very pale. “I know nothing about this,” he said, looking round;
“nothing. I hope everybody will believe me. I want to know who he is!”
No one said a word, they all stood round, struck silent, not knowing
what to think. Mrs. Harwood stood with her hand upon the table, supporting
herself, asking no other support. She was perfectly pale, but her
countenance had recovered its features and expression. She did not even
look at her children—one on her knees, one standing up confronting her,
demanding to know the truth. To neither of them did she give a word or
look. Her eyes were fixed upon the man who was thus utterly in her hands.
Vicars extracted an old, large pocket-book from the pocket of the patient,
and handed it to her, not without a sort of smile—half-mocking—on his
face. She took it, glancing at it with a certain disdain, as if the trick, often
employed but no longer necessary, had disgusted her, and flung it on the
table.
“There are in this book,” she said, “old scraps of paper of no value. This
is what I am to pay his debts with. He has given it to me twenty times
before. I get tired in the end of playing the old game over and over.”
“Mother who is he?” cried Dolff. “You have had him in your house, in
secret, never seeing the light of day, and I, your son, never knew. Who is
he?”
Mrs. Harwood made no reply.
It was a question to which no one there could give any answer, except
perhaps Gussy—on her knees, with her hands covering her face—who did
not look up or give any attention to what was going on. Meredith alone
seemed to have some clear idea in his mind: his face shone with aroused
interest and eagerness, like a man on the very trace of knowledge of the
utmost importance to him. A rapid process of thought was going on in his
mind, his intelligence was leaping from point to point.
“You will perhaps be surprised,” he said, “to hear that I have known this
for some time.”
“You!” Mrs. Harwood half turned to him, a gleam as of fire passing over
her face. “You!”
“Yes, I, who have several interests involved. I had just received
information on the subject when that young fool, thinking heaven knows
what other folly, knocked me down, taking me unawares, and nearly killed
me. Oh, yes, it is perfectly true it was Dolff who did it. You start as if I were
likely to make any fuss on that subject. Is it true that he had the money to
pay everybody?—that is what I want to know.”
“Charley, Charley, do you mean to say that Dolff——”
“Oh, I mean nothing about Dolff,” he said, impatiently: “answer me,
Mrs. Harwood.”
“I can’t answer for nothing, Mrs. Harwood,” cried Vicars, “if you keep a
lot of folks round him. He is working himself up into a fury again.”
The madman was twisting in his chair, fighting against the mechanical
bonds that secured him. He was looking towards the pocket-book which lay
on the table.
“She has got my money, and she throws it down for anybody to pick
up,” he cried. “My money! there’s money there to pay everything! Why
don’t you pay those people and let ’em go—pay them, pay them and let
them go! or else give me back my money!” he cried, wildly straining
forward, with his white hair falling back, his reddened eyes blazing,
struggling against his bonds. Mrs. Harwood took up the pocket-book,
weighing it, with a sort of forced laugh, in her hand.
“You think there may be a fortune here—enough to pay? And he thinks
so. Give it to him, Vicars. We’ve tried to keep it all quiet, but it seems we
have failed. You may leave the door open now—you may do as you please.
It can’t matter any longer. I have thought of the credit of the family, and of
many things that nobody else thinks of. And of his comfort—nobody will
say I have not thought of his comfort. Look round you: there is everything,
everything we could think of. But it is all of no use now.”
The old man had caught the pocket-book from Vicars’ hands with a
pitiful demonstration of joy. He made a pretence of examining its contents,
eagerly turning them over as if to make sure that nothing was lost, kissing
the covers in enthusiasm of delight. He made an attempt with his confined
arms to return it to his pocket, but, failing in that, kept it embraced in both
his hands, from time to time kissing it with extravagant satisfaction.
“As long as I have got this they can do nothing to me,” he said.
While this pantomime was going on, and while still Mrs. Harwood was
speaking, a little movement and rustle in the group caught everybody’s
attention as if it had been a new fact: but it was only Janet stealing away
behind the others who had a right there which she did not possess. She had
been watching her moment. She herself, who had nothing to do with it, had
received her share of discomfiture too. Her heart was sinking with
humiliation and shame. What had she to do with the mysteries of the
Harwoods, the things they might have to conceal? What was she to them
but a stranger of no account, never thought of, dragged into the midst of
their troubles when it pleased them, thrown off again when they chose?
Nobody would have said that Janet had any share in this crisis, and yet it
was she who had received the sharpest arrow of all; or so, at least, she
thought. She slipped behind Julia, who was bigger and more prominent than
she, and stole through the bewildering stairs and passages. How well she
seemed to know the way, as if it had been familiar to her for years! And it
was she who had given the information—she who had been the cause of
everything, drawn here and drawn there into affairs alike alien to her, with
which she had nothing to do. They were all moved by her departure; not
morally, indeed, but by the mere stir it caused.
Gussy rose from her knees, showing a countenance as pale as death and
still glistening with tears. She said,
“Mamma, shall we go away? Whatever there may be to be said or
explained, it ought not to be done here.” She went up to the old man in the
chair, who was still embracing his pocket-book, and kissed him on the
forehead. “If any wrong has been done to you, I don’t know of it,” she said;
“I thought it was nothing but good.”
“No wrong has been done to him—none—none,” cried Mrs. Harwood,
suddenly dropping from her self-command and strength. “Children, you
may not believe me, since I’ve kept it secret from you. There has been no
wrong to him—none—none. If there has been wrong, it has not been to
him. Oh, you may believe me, at least, for I have never told you a lie.
Everything has been done for him. Look round you—look round you and
you will see.”
“Who is he?” said Dolff, obstinate and pale, standing behind the chair.
“You have no thought for me,” said the mother. “You see me standing
here, come here to defend you all, in desperation for you, and you never ask
how I am to get back, whether it will kill me—— No, no, Janet has gone,
who supported me, who was a stranger, and asked no questions, but only
helped a poor woman half mad with trouble and distress. Ah!” she said, “he
could go mad and get free—he who was the cause of it all: but I have had to
keep my sanity and my courage and bear it all, and look as if nothing was
the matter, for fifteen years. For whom? Was it for me? It would have been
better for me to have died and been done with it all. For you, children, to
give you a happy life, to do away with all disgrace, to give you every
advantage. Yes, I’ll take your arm, Ju: you have not been a good child, but
you know no better. Get me to my chair before I drop down; get me to my
chair——” She paused a moment, and looked round with a hard laugh. “For
I am very heavy,” she said, “and I would have to be carried, and who would
do it I don’t know. Ju, make haste, before my strength is all gone. Get me to
my chair.”
CHAPTER XLIII.
Gussy was the last to leave of that strange procession, of whom no one
spoke to the other. She closed the door after her, and the curtains, and
followed the erect figure of Dolff, drawn up as it never had been in his life
before, and walking stiffly, as if carrying a new weight and occupying a
position unknown. They all came into the hall, defiling solemnly one after
the other, to find Mrs. Harwood deposited in her chair and awaiting them,
almost as if the whole events of the evening had been a dream and she had
never left that spot. It was with a strange embarrassment, however, that they
looked at each other in the pale, clear light as they emerged from the
doorway, almost like making new acquaintance, as if they had never seen
each other before. Nobody certainly had seen Dolff in that new
manifestation; nor was Gussy, she whose very existence had been wrapped
up in that of Meredith, who had only lived to watch him for weeks past,
recognizable. It was she who came out the last, but who made herself the
first of the group.
“There may be a great many things to say,” said Gussy; “but not to-
night. We have all had a great many agitations to-night. My brother has
been hunted for his life. My mother has done a thing which, so far as we
know, she hasn’t been able to do for years. Mr. Meredith has had a bad
illness, for which it appears this unfortunate family is responsible too. I
only and my little sister”—she paused here with an effort—“no; I will not
pretend; I have had my share of the shock, too. We’d better all separate for
the night.”
“Gussy!” cried Mrs. Harwood, with a sharp tone of appeal.
“Gussy!” cried Meredith, astonished, trying to take her hand to draw her
towards him.
“Gussy!” said Dolff, with a certain indignation.
“It is of no use,” she said, quickly, “to appeal to me. I think I am the one
who has been deceived all round. I thought I knew everything, and I’ve
known nothing. Whatever may be the meaning of it, I for one am not able
for any more to-night, and none of the rest ought to be able for it. I don’t
know whether I may have been deceived there, too, about how much
invalids could bear. Good-night, mamma. I advise you to get to bed.”
Gussy waved her hand to the others without a word, and walked upstairs
without turning her head. The sudden failure of a perfect faith in all the
world, such as she had entertained without entering into complications for
which her mind was not adapted, is no small matter. It is alarming even for
others to see. They all stood for a moment huddled together as if a rock or a
tower had fallen before their eyes. They could scarcely see each other for
the dust and darkness it made. All the other events of this startling night
seemed to fall into the background. Gussy! who had been the central prop
of the house, who had kept everybody together, done everything! When she
thus threw up her arms they were all left in dismay, and fell into an
assemblage of atoms, of units—no longer a united party ready to meet all
comers.
Meredith, perhaps, he who had been the most eager, was the most
discomfited of all. He had claimed Gussy’s interest as his right for years.
When she thus withdrew, not even asking if he were fatigued, speaking
almost as if she thought that fatigue a pretence, he was so bewildered that
he could do nothing. An anxious believer like this is accepted perhaps with
too much faith and considered too inalienable a possession; and when she
fails the shock is proportionately great. Without Gussy to stand by him, to
make him believe himself a universal conqueror, always interesting, always
important, Meredith for the moment was like an idol thrown from his
pedestal. He was more astonished than words could say. He exclaimed,
hurriedly,
“I think Gussy is right, as she always is. Mrs. Harwood, I will say good-
night.”
Mrs. Harwood was altogether in a different mind. The period of reaction
had not come with her as yet. She had got herself deposited in her chair in
time enough to save her from any breaking down. And her spirit was full of
excitement.
“I am ready,” she said, with a panting hot breath of mental commotion,
“to explain—whatever it is necessary to explain. Take me back to my room,
Dolff. It is cold here.”
“Good-night,” said Meredith. “I will not encroach upon you longer to-
night.”
“As you like,” she said. “I warn you, however, that to-morrow——
Dolff, take me back to my fire.”
Dolff was unsubdued, like his mother. The reaction from a long period of
suspense, and the sense of safety after a great alarm, no doubt acted upon
his mind: though, so far as he was aware, he was moved by nothing save the
overwhelming discovery he had made, and his indignant sense of wrong in
finding such a secret retreat unsuspected, in his mother’s—in his own—
house.
“We’ll be better alone,” he said, in the stern tone which was so new to
him, putting his hand upon her chair; “but perhaps you could walk if you
tried,” he added, with rude sarcasm.
He drove rather than wheeled her before him into the deserted room,
where all was so brilliant and warm, the light blinking in the bright brass
and steel, the lamps serenely burning, everything telling of the tranquil life,
unbroken by any but cheerful incidents, which had gone on there for so
many years.
“Now, mother,” said Dolff, “we have got to have it out. Who is that man
upstairs?”
Julia had followed them unremarked, and remained behind her mother’s
chair. Dolff stood before them, in the full firelight, very erect, inspired with
indignation and that sense of superiority which injury gives. It had elevated
him altogether in the scale of being. His own shortcomings had fallen from
his consciousness. He was aware of nothing but that he, Dolff, in reality the
head of the family, had been deceived and compromised.
Mrs. Harwood took but little notice of her son. She took up her work
which had been thrown upon the table and turned it over in her fingers.
“Gussy was right,” she said, “though she was a little brusque in her way
of saying it. I am certainly unable to bear anything more to-night.”
“I suppose, however, you can answer my question,” said Dolff.
“Go to bed, boy,” said his mother, “and don’t worry me. We have two or
three things to talk over, you and I, which are too much for to-night.”
“I am not a boy any longer,” cried Dolff; “you have made me a man.
Who is it you have been hiding for years upstairs?”
She gave vent to a little fierce laugh.
“For my pleasure,” she said; “for my amusement, as anybody may see.”
“Whether it is for your amusement or not,” said Dolff, “I am of age, and
I have a right to know who is living in my house.”
“In your house!” Her exasperation was growing. “Don’t force me, Dolff,
to go into other questions to-night.”
“Whose house is it?” he said. “There’s been no question, because you
have kept everything in your hands; but if I am to be driven to it, and claim
my rights——”
“Your rights!” she cried, again repeating his words. “Was it one of your
rights to knock down a man like a coward from behind? It appears this is
what you think you may be permitted to do with impunity—to have your
home searched in every corner and to destroy all that I have been doing for
years, and to bring shame and disgrace to a house that I have kept free of
shame, almost at the risk of my life!”
“I did not,” cried Dolff, interrupting her eagerly. “I did not knock him
down from behind. I had not time to think. I let fly at him as I passed. It’s a
lie to say I knocked him down from behind.”
“You did the same thing; you took him unawares. And you dare to
question me! You killed a man at my door—or meant to do it—and never
breathed a word to warn us, to keep us from the disgrace——”
Dolff was not clever enough to know what to say. His snort of rage was
not attended by any force of bitter words. He only could repeat, with rage
and incompetence,
“At your door?”
“Perhaps,” said Mrs. Harwood, half carried away by passion, half
influenced by the dismay which she knew she had it in her power to call
forth, “it would be better, since you are exact, to say at your father’s door.”
Dolff responded with a strange cry. He did not understand it, but he felt
all the same that a blow which stunned him had been directed at him, and
that the ground was cut from beneath his feet.
“He has neither been tried, nor sentenced, nor anything proved against
him,” cried Mrs. Harwood, carried away now by the heat of her own
excitement. “All that has to be gone through before he can be put aside.
And at this moment everything’s his—the roof that covers you, the money
you have been spending. It is no more your house—your house!—than it is
Julia’s. It is your father’s house.”
“My father is dead,” said Dolff, who had again grown very pale, the
flush of passion dying out of his face.
“Yes,” said Mrs. Harwood, “and might have remained so, had it not been
for your cowardly folly and Vicars’s infatuation for you. How was it the
man had not the sense to see that a fool like you would spoil all?”
“You are dreaming, you are mad,” said Dolff; “you are telling me
another lie.”
But, though he said this with almost undiminished passion, the young
fellow’s superiority, his erect pose, his sense of being able to cow and
overwhelm her, had come to an end. He fell into his usual attitude, his
shoulders dropped and curved, his head hung down. He could fling a last
insult at his mother, but no more. And his own mind began to be filled with
unfathomable dismay.
Julia had been very uncertain what side to take. Her mind went naturally
with her brother, who was most near herself. But a mother is a mother after
all. You may feel her to be in some way your natural enemy when the
matter is between yourself and her; but when another hand plucks at her it
is different. A girl is not going to let her mother be insulted, who after all
means her own side, without interposing. Julia suddenly flew forth from
behind her mother’s chair and flung herself upon Dolff’s arm, seizing it and
shaking him violently.
“How dare you speak to her like that?” cried Ju, “you that can’t do
anything you try—not even kill Charley Meredith when you have the
chance! I should be ashamed to look any one in the face. Go away, go away,
and leave us quiet, you that have done it all: that brought the police into the
house, and yet did not hurt him to speak of, you great, useless,
disappointing boy!”
Dolff did not know how to sustain this sudden assault. He looked round
stupidly at the active assailant at his shoulder with a little pang, even in his
agitated and helpless state, to find that Julia was no longer on his side. His
head was going round and round: already in his soul he had entirely
collapsed, although he still kept his feet in outward appearance. And it
would have been difficult to end this scene without an entire breakdown on
one side or the other, had not the pensive little voice of the parlor-maid
become audible at this moment over their heads, making them all start and
draw back into themselves.
“If you please, ma’am,” said Priscilla, “for I can’t find Miss Gussy—
shall I take Mr. Meredith’s tray to his room, or shall I bring it in here?”
“I think Mr. Meredith is going to bed,” said Mrs. Harwood; “he is a little
tired. Take it into his room, Priscilla. And Miss Gussy has gone to bed; you
may come now and help me to get into my room, and then shut up
everything. It is later than I thought.”
“Yes, ma’am,” said Priscilla, in those quiet tones of commonplace which
calm down every excitement.
Priscilla indeed was herself bursting with curiosity and eagerness to find
out what had happened. The long-shut-up door stood ajar, and every maid
in the house had already come to peep into the dark passage and wonder
what it led to: and the keenest excitement filled the house. But a parlor-
maid has as high a standard of duty as any one, were it an archbishop. It
was against the unwritten household law to show any such commotion. She
took hold of the handle of her mistress’s chair as she did on the mildest of
domestic evenings, and drew her very steadily and gently away. The only
revelation she made of knowing anything was in the suggestion that a little
gruel with a glass of wine in it would be a proper thing for Mrs. Harwood to
take.
“You may bring me the glass of wine without the gruel,” Mrs. Harwood
was heard saying as the sound of her wheels moved slowly across the hall,
an hour ago the scene of such passionate agitation. “I don’t think I have
caught cold. A glass of wine—and a few biscuits,” she said as by an
afterthought.
Was this part of the elaborate make-believe intended to deceive the
servants and persuade them that nothing particular had happened? or was
she indeed capable of munching those biscuits after such a night of fate?
“Ju, don’t you turn against me,” said Dolff, feebly, throwing himself into
a chair when they were thus left alone.
“Oh!” cried Julia, still panting with her outburst, “to think you had hold
of him and didn’t really hurt him, not to matter! I can never, never forgive
you, Dolff.”
“Oh, hold your tongue, you little fool; the only thing I’m glad of is that I
didn’t hurt him—to matter! You don’t know what it is to live for a long
week, all the time he was insensible, thinking you have killed a man!”
“When it was only Charley Meredith!” Julia said.
CHAPTER XLIV.
It was strange that it should be Gussy, who was not ideal or visionary,
but very matter-of-fact in all her ways, who was the most cruelly offended
and wounded by the events of this night. It seemed to Gussy that she had
been deceived and played upon by everybody. By her mother, who had
never confided to her the gravity of the position, though she had known the
fact for years; by Meredith, who had seemed to know more of it than Gussy
did, and whose eyes had been keen with understanding, following every
word of what was to Gussy merely the ravings without consequence of a
madman; he knew more of it than she did, who had helped to take care of
the secret inmate. And then Dolff, her brother. What was the meaning of
this cloud of tempest which had come into Dolff’s trivial, schoolboyish life?
Why had he tried to kill, if that was what he wanted, or, at least, to injure, to
assault Meredith?
It was all a mystery to Gussy. She understood nothing except that many
things had been going on in the house which she either did not know at all
or knew imperfectly—that she had been possibly made a dupe of, brought
down from the position which she had seemed to hold of right as the chief
influence in the family. She had thought this was how it was: her mother’s
confidant, the nurse and guardian-angel of her lover, the controller, more or
less, of all the house. And it turned out that she knew nothing, that there
were all kinds of passions and mysteries in her own home with which she
was unacquainted, that what she knew she knew imperfectly, and that even
in the confidences given to her she had been kept in the dark.
Gussy was not imaginative, and consequently had little power of
entering into the feelings or divining the movements of the minds of others.
She was wounded, mortified to the depths of her heart, and angry, with a
deep, silent anger not easily to be overcome. She did not linger nor ask for
explanations, but went straight up to her room without a moment’s pause,
careless that both her mother, whom she generally attended through the
troublesome process of undressing, and Julia, whom she usually held under
such strict authority, were left behind, the latter in contempt of all ordinary
hours. Janet, whose charge that was, was not visible; she had stolen away,
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.
ebooknice.com