100% found this document useful (2 votes)
17 views

Command-Line Rust 1st Edition Ken Youens-Clark instant download

Command-Line Rust is a project-based primer by Ken Youens-Clark focused on writing command-line interfaces (CLIs) using the Rust programming language. The book covers various topics including project organization, command-line argument parsing, and testing, providing practical examples and solutions. It is published by O'Reilly Media and is aimed at developers looking to enhance their skills in Rust for CLI applications.

Uploaded by

shezzsantoa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
17 views

Command-Line Rust 1st Edition Ken Youens-Clark instant download

Command-Line Rust is a project-based primer by Ken Youens-Clark focused on writing command-line interfaces (CLIs) using the Rust programming language. The book covers various topics including project organization, command-line argument parsing, and testing, providing practical examples and solutions. It is published by O'Reilly Media and is aimed at developers looking to enhance their skills in Rust for CLI applications.

Uploaded by

shezzsantoa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 55

Command-Line Rust 1st Edition Ken Youens-Clark

download

https://ebookmeta.com/product/command-line-rust-1st-edition-ken-
youens-clark/

Download more ebook from https://ebookmeta.com


We believe these products will be a great fit for you. Click
the link to download now, or visit ebookmeta.com
to discover even more!

Command Line Rust A Project Based Primer for Writing


Rust CLIs 1st Edition Ken Youens Clark

https://ebookmeta.com/product/command-line-rust-a-project-based-
primer-for-writing-rust-clis-1st-edition-ken-youens-clark/

Command Line Rust A Project Based Primer for Writing


Rust CLIs 1st Edition Ken Youens-Clark

https://ebookmeta.com/product/command-line-rust-a-project-based-
primer-for-writing-rust-clis-1st-edition-ken-youens-clark-2/

Reproducible Bioinformatics with Python First Early


Release Ken Youens Clark

https://ebookmeta.com/product/reproducible-bioinformatics-with-
python-first-early-release-ken-youens-clark/

Mathematical Modeling in the Age of the Pandemic


Textbooks in Mathematics 1st Edition William P. Fox

https://ebookmeta.com/product/mathematical-modeling-in-the-age-
of-the-pandemic-textbooks-in-mathematics-1st-edition-william-p-
fox/
Sailing in Paradise 1st Edition Rod Heikell

https://ebookmeta.com/product/sailing-in-paradise-1st-edition-
rod-heikell/

Problems and Solutions on Thermodynamics and


Statistical Mechanics Second Edition Swee Cheng Lim

https://ebookmeta.com/product/problems-and-solutions-on-
thermodynamics-and-statistical-mechanics-second-edition-swee-
cheng-lim/

About language Tasks for teachers of English 2nd


Edition Scott Thornbury

https://ebookmeta.com/product/about-language-tasks-for-teachers-
of-english-2nd-edition-scott-thornbury/

A Man's Word 2: An Isekai Fantasy (Princess or Three in


Distress) 1st Edition Marcus Sloss & Stoham Baginbott

https://ebookmeta.com/product/a-mans-word-2-an-isekai-fantasy-
princess-or-three-in-distress-1st-edition-marcus-sloss-stoham-
baginbott/

Spur It On Falling For The Bull Riders 2 1st Edition


Kitty Cox

https://ebookmeta.com/product/spur-it-on-falling-for-the-bull-
riders-2-1st-edition-kitty-cox/
Putin's Prisoner 1st Edition Aiden Aslin

https://ebookmeta.com/product/putins-prisoner-1st-edition-aiden-
aslin/
Command-Line

Rust

A Project-Based Primer for Writing Rust CLIs

Ken Youens-Clark
Command-Line Rust

A Project-Based Primer for Writing Rust CLIs

Ken Youens-Clark

Beijing Boston Farnham Sebastopol Tokyo

Command-Line Rust

by Ken Youens-Clark

Copyright © 2022 Charles Kenneth Youens-Clark. All rights reserved.

Printed in the United States of America.

Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North,


Sebastopol, CA 95472.

O’Reilly books may be purchased for educational, business, or sales


promotional use. Online editions are also available for most titles (
http://oreil y.com). For more information, contact our
corporate/institutional sales department: 800-998-9938 or
corporate@oreil y.com.

Acquisitions Editor: Suzanne McQuade

Proofreader: Rachel Head

Development Editors: Rita Fernando and

Indexer: Ellen Troutman-Zaig

Corbin Collins

Interior Designer: David Futato

Production Editors: Caitlin Ghegan and


Cover Designer: Karen Montgomery

Gregory Hyman

Illustrator: Kate Dullea

Copyeditor: Kim Sandoval

January 2022:

First Edition

Revision History for the First Edition

2021-01-13: First Release

See http://oreil y.com/catalog/errata.csp?isbn=9781098109431 for


release details.

The O’Reilly logo is a registered trademark of O’Reilly Media, Inc.


Command-Line Rust, the cover image, and related trade dress are
trademarks of O’Reilly Media, Inc.

The views expressed in this work are those of the author and do not
represent the publisher’s views. While the publisher and the author
have used good faith efforts to ensure that the information and
instructions contained in this work are accurate, the publisher and
the author disclaim all responsibility for errors or omissions, including
without limitation responsibility for damages resulting from the use of
or reliance on this work. Use of the information and instructions
contained in this work is at your own risk. If any code samples or
other technology this work contains or describes is subject to open
source licenses or the intellectual property rights of others, it is your
responsibility to ensure that your use thereof complies with such
licenses and/or rights.

978-1-098-10943-1
[LSI]

Table of Contents

Preface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . ix

1. Truth or Consequences. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.........................1

Getting Started with “Hello, world!” 1

Organizing a Rust Project Directory 3

Creating and Running a Project with Cargo 4

Writing and Running Integration Tests 6

Adding a Project Dependency 10

Understanding Program Exit Values 11

Testing the Program Output 14

Exit Values Make Programs Composable 15

Summary 16

2. Test for Echo. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .


. . . . . . . . . . . . . . . . . . . . . . . . . 17

How echo Works 17

Getting Started 20

Accessing the Command-Line Arguments 21

Adding clap as a Dependency 23


Parsing Command-Line Arguments Using clap 25

Creating the Program Output 29

Writing Integration Tests 33

Creating the Test Output Files 34

Comparing Program Output 35

Using the Result Type 36

Summary 41

iii

3. On the Catwalk. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . 43

How cat Works 44

Getting Started 48

Starting with Tests 48

Creating a Library Crate 50

Defining the Parameters 51

Iterating Through the File Arguments 56

Opening a File or STDIN 56

Using the Test Suite 59

Solution 63

Reading the Lines in a File 63


Printing Line Numbers 64

Going Further 67

Summary 67

4. Head Aches. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . 69

How head Works 70

Getting Started 73

Writing a Unit Test to Parse a String into a Number 75

Converting Strings into Errors 77

Defining the Arguments 80

Processing the Input Files 83

Reading Bytes Versus Characters 85

Solution 86

Reading a File Line by Line 86

Preserving Line Endings While Reading a File 86

Reading Bytes from a File 88

Printing the File Separators 91

Going Further 92

Summary 92

5. Word to Your Mother. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .


. . . . . . . . . . . . . . . . . . . . . . . . . 95
How wc Works 95

Getting Started 100

Iterating the Files 105

Writing and Testing a Function to Count File Elements 106

Solution 109

Counting the Elements of a File or STDIN 109

Formatting the Output 111

Going Further 117

Summary 117

iv | Table of Contents

6. Den of Uniquity. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . 119

How uniq Works 119

Getting Started 124

Defining the Arguments 125

Testing the Program 129

Processing the Input Files 133

Solution 134

Going Further 139

Summary 140
7. Finders Keepers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . 141

How find Works 142

Getting Started 146

Defining the Arguments 147

Validating the Arguments 153

Finding All the Things 155

Solution 157

Conditionally Testing on Unix Versus Windows 163

Going Further 166

Summary 167

8. Shave and a Haircut. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .


. . . . . . . . . . . . . . . . . . . . . . . 169

How cut Works 169

Getting Started 174

Defining the Arguments 175

Parsing the Position List 181

Extracting Characters or Bytes 187

Parsing Delimited Text Files 189

Solution 191

Selecting Characters from a String 191


Selecting Bytes from a String 193

Selecting Fields from a csv::StringRecord 195

Final Boss 196

Going Further 198

Summary 198

9. Jack the Grepper. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .


. . . . . . . . . . . . . . . . . . . . . . . 201

How grep Works 202

Getting Started 205

Defining the Arguments 206

Finding the Files to Search 212

Table of Contents | v

Finding the Matching Lines of Input 215

Solution 219

Going Further 223

Summary 223

10. Boston Commons. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .


. . . . . . . . . . . . . . . . . . . . . . . . . 225

How comm Works 225

Getting Started 229

Defining the Arguments 229


Validating and Opening the Input Files 233

Processing the Files 235

Solution 236

Going Further 244

Summary 244

11. Tailor Swyfte. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .


. . . . . . . . . . . . . . . . . . . . . . . . 245

How tail Works 245

Getting Started 250

Defining the Arguments 250

Parsing Positive and Negative Numeric Arguments 255

Using a Regular Expression to Match an Integer with an Optional Sign


256

Parsing and Validating the Command-Line Arguments 260

Processing the Files 262

Counting the Total Lines and Bytes in a File 262

Finding the Starting Line to Print 264

Finding the Starting Byte to Print 265

Testing the Program with Large Input Files 266

Solution 267

Counting All the Lines and Bytes in a File 267


Finding the Start Index 268

Printing the Lines 269

Printing the Bytes 271

Benchmarking the Solution 273

Going Further 275

Summary 275

12. Fortunate Son. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .


. . . . . . . . . . . . . . . . . . . . . . . . 277

How fortune Works 278

Getting Started 281

Defining the Arguments 282

Finding the Input Sources 288

vi | Table of Contents

Reading the Fortune Files 291

Randomly Selecting a Fortune 293

Printing Records Matching a Pattern 295

Solution 296

Going Further 301

Summary 301

13. Rascalry. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . 303
Discovering Diverse Content Through
Random Scribd Documents
The Project Gutenberg eBook of
Capture and Escape: A Narrative of Army and
Prison Life
This ebook is for the use of anyone anywhere in the United States
and most other parts of the world at no cost and with almost no
restrictions whatsoever. You may copy it, give it away or re-use it
under the terms of the Project Gutenberg License included with this
ebook or online at www.gutenberg.org. If you are not located in the
United States, you will have to check the laws of the country where
you are located before using this eBook.

Title: Capture and Escape: A Narrative of Army and Prison Life

Author: John Azor Kellogg

Release date: March 14, 2016 [eBook #51451]


Most recently updated: October 23, 2024

Language: English

Credits: Produced by Martin Pettit and the Online Distributed


Proofreading Team at http://www.pgdp.net (This file was
produced from images generously made available by The
Internet Archive)

*** START OF THE PROJECT GUTENBERG EBOOK CAPTURE AND


ESCAPE: A NARRATIVE OF ARMY AND PRISON LIFE ***
Transcriber's Note:

Obvious typographic errors have been


corrected.

CAPTURE AND ESCAPE


JOHN AZOR KELLOGG

Wisconsin History Commission: Original Papers, No. 2


CAPTURE AND ESCAPE
A NARRATIVE OF ARMY AND
PRISON LIFE

BY JOHN AZOR KELLOGG


Colonel of Sixth Wisconsin Volunteer Infantry and Brevet
Brigadier-General

WISCONSIN HISTORY COMMISSION


NOVEMBER, 1908

TWENTY-FIVE HUNDRED COPIES PRINTED

DEMOCRAT PRINTING CO., STATE PRINTER


Contents
PAGE
Wisconsin History Commission ix
Preface xi
Capture and Escape: a Narrative of Army and
Prison Life. John Azor Kellogg
The Iron Brigade in camp 1
On the skirmish line 4
Captured 11
En route to Lynchburg 13
Arrival at Lynchburg 21
Treatment at Lynchburg 24
At Danville 28
Removed to Macon 29
Prison pen 33
Tunnelling 40
Betrayed 43
Prison life 49
Removed to Charleston 52
Escape from the train 58
Prisoners again 65
Confined at Charleston 71
Another tunnel 73
In the line of Union fire 81
Daily experiences 85
A second escape 92
Fugitives 97
Two of us missing 105
A friend in the dark 111
Novel foot-gear 116
Interrupting a revival 122
Negro sympathizers 126
Hunted with hounds 130
Friendly blacks 140
Difficulties, day by day 148
A cautious picket 157
The Home Guard 160
Among the Georgia Unionists 165
A mountain wedding 173
Diplomacy 179
A start for our lines 181
Among comrades 189
The mystery solved 195
Again in the field 198
A belated report 200
Illustration
Portrait of Author, while Colonel of Sixth Wisconsin
Infantry Frontispiece
Wisconsin History Commission
(Organized under the provisions of Chapter 298, Laws of 1905, as
amended by Chapter 378, Laws of 1907)
JAMES O. DAVIDSON
Governor of Wisconsin
FREDERICK J. TURNER
Professor of American History in the University of Wisconsin
REUBEN G. THWAITES
Secretary of the State Historical Society of Wisconsin
HENRY E. LEGLER
Secretary of the Wisconsin Library Commission
CHARLES E. ESTABROOK
Representing Department of Wisconsin, Grand Army of the
Republic

Chairman, Commissioner Estabrook


Secretary and Editor, Commissioner Thwaites
Committee on Publications, Commissioners Legler, Thwaites, and Turner
PREFACE
John Azor Kellogg, author of the Commission's Original Narrative No.
2, was born on the 16th of March, 1828, at Bethany, in Wayne
County, Pennsylvania, the son of Nathan and Sarah (Quidor) Kellogg.
Nathan's father was an American soldier in the Revolutionary War;
he himself a tavern-keeper, stage proprietor, and general contractor.
The Kelloggs moved to Wisconsin Territory about 1840, settling at
Prairie du Chien.
John's early youth was spent in farm work, his education being
confined to three winters at a private school. When eighteen years
of age, he began reading law; at first taking a correspondence
course with George W. Woodward, later chief justice of
Pennsylvania, but completing his studies with S. S. Wilkinson of
Prairie du Sac. Mr. Kellogg was one of the founders of the Republican
Party, being a member of the Madison convention of September 5,
1855.
Admitted to the bar in 1857, in his twenty-ninth year, he opened an
office at Mauston. In November, 1860, he was elected district
attorney of Juneau County, but resigned in April, 1861, to enlist in
the Union Army. His earliest military experience was as First
Lieutenant of the Lemonweir Minute Men, an organization that
became Company K of the Sixth Wisconsin Volunteer Infantry—his
commission being dated May 3. The several companies composing
this regiment were mustered into Federal service at Camp Randall, in
Madison, on the 16th of July, and twelve days later left for the front.
On December 18 following, Lieutenant Kellogg was promoted to be
Captain of Company I. He served actively with his company until
January, 1863; but was then appointed adjutant-general of the
famous Iron Brigade (of which the Sixth Wisconsin was a member),
holding that position until the following January, when he returned
to duty with his regiment.
Captain Kellogg participated in the battles of Gainesville, Second Bull
Run, South Mountain, Antietam, Fredericksburg, Chancellorsville,
Rappahannock Station, Mine Run, and Gettysburg. It was during the
great Fight in the Wilderness, while the Iron Brigade was of the
Army of the Potomac, that our author was captured (May 5, 1864)
by Confederates, while he was doing skirmish duty on special detail.
Imprisoned successively at Lynchburg and Danville (Virginia), Macon
(Georgia), and Charleston (South Carolina), he escaped on October
5 by jumping from a rapidly-moving railroad train while he and his
fellow prisoners were being transported to Columbia.
The story of his depressing experiences in Confederate prisons, and
of his curious adventures while a fugitive after the escape, is told in
the present volume. A man of acute intellect, resourceful, and
courageous in an unusual degree, Captain Kellogg's narrative is a
document of great human interest. His literary style is as vivid as his
experiences were thrilling, and the modest tale is certain to hold the
attention of the most jaded reader of war-time reminiscences. The
Commission considers itself fortunate in being able to include in this
series so admirable a paper.
While Captain Kellogg was absent in captivity, or before his safe
return to the Union lines at Calhoun, Georgia (October 26), he was
twice promoted—September 1, to be Major of his regiment; October
19, to be its Lieutenant-Colonel. Soon after assuming the last-named
office (November), he was made Colonel of the regiment. Being
assigned to the command of the Iron Brigade in February, 1865, he
led that redoubtable organization in the battles of Hatcher's Run,
Boydon Plank Road, Gravel Run, Five Forks, High Bridge, and
Appomattox. On the 9th of April he was deservedly brevetted
brigadier-general, "for highly meritorious service during the
campaign terminating with the surrender of the insurgent army
under General Robert E. Lee," and on July 14 following was
mustered out.
Being appointed United States Pension Agent at La Crosse, General
Kellogg removed to that city in the spring of 1866, remaining there
until July, 1875, having resigned his position in April of that year. He
now settled in Wausau, successfully resuming the practice of his
profession, and in 1879-80 represented his district in the State
Senate. His death occurred at Wausau, February 10, 1883, in the
fifty-fifth year of his age. Married on October 5, 1852, to Miss
Adelaide Worthington of Prairie du Sac, he left three children of the
five born unto them.
General Kellogg published a narrative of the adventures herein
related, in a series of articles in the La Crosse Leader, between
September 25, 1869, and January 15, 1870. In its present amplified
and improved form, the story appears, from internal evidence, to
have been written in 1882, a year before his death. We are indebted
for our manuscript copy to his widow, now living in Faribault,
Minnesota. The portrait of the author, given as our frontispiece, is
from a photograph taken in Madison while he was Colonel of his
regiment—probably quite soon after his return from captivity.
The purpose of the Commission is merely to select and publish such
material bearing upon Wisconsin's part in the War of Secession as,
from considerations of rarity or of general excellence, it is deemed
desirable to disseminate. Opinions or errors of fact on the part of the
respective authors have not been modified or corrected by the
Commission—save as members may choose to append thereto
individually-signed foot-notes. For all statements, of whatever
character, the author alone is responsible, whether the publication
be in the form of Original Narratives or of Reprints.
The Commission is indebted to Miss Annie A. Nunns, of the
Wisconsin Historical Library staff, for supervising the reading of the
proof.
R. G. T.
WISCONSIN HISTORICAL LIBRARY
November, 1908
CAPTURE AND ESCAPE
The Iron Brigade in Camp
On the morning of the third of May, 1864, the Army of the Potomac
confronted the Confederates on the banks of the Rapidan.
The consolidated First and Fifth Army Corps was commanded by
Major-General George G. Warren.[1] To this corps was attached that
part of the Army of the Potomac known as the Iron Brigade, then
under the command of General Lysander Cutler, one of the ablest of
our volunteer generals. To this brigade was attached the Sixth
Wisconsin, commanded by Colonel (afterwards General) Edward S.
Bragg. I commanded Company I in this regiment.[2]
Fearing a repetition of the long, cold winter of 1863-64, the army,
under the immediate supervision of that thorough soldier, General
George G. Meade, had been re-organized, completely equipped, and
fitted for the stern duties of the next campaign.
The hills around Culpeper were dotted with the white tents and rude
yet more comfortable cabins of the patriot soldiers. All along the
banks of the Rapidan, at regular intervals, curled the smoke of the
picket fires. Beyond them trod the weary sentinels, whose watchful
eyes and stalwart arms had for twenty-four hours guarded their
comrades in camp from surprise and consequent disaster. But now
the allotted time for relief had come, and they stole an occasional
impatient glance toward the long blue column winding its way along
the turnpike toward the reserve post, knowing that it was the relief
guard that was to take their place in the tedious, irksome, and
sometimes dangerous outpost duty.
In camp, here and there, might have been seen a regiment
executing the beautiful evolutions of battalion drill, and perhaps a
camp guard being mounted, the air meanwhile resounding with the
martial music so inspiring to the soldier. To the civilian all would have
seemed confusion; but to the soldier the scene simply represented
an army at rest; his eye could only see the monotonous details of
camp life, the every-day life of the soldier. Such had been the daily
routine through weary months of waiting, until all were eagerly
anticipating the order to move.
As the sun disappeared that night, behind the western hills, its last
beams shone upon an army whose banners floated from every
hillside and valley as far as the eye could reach; and as the camp
fires came out in the deepening twilight, they glimmered and
sparkled like the lights of some great city.
The camp guards paced their well-trodden beats. The confused
murmur of thousands of voices mingled together, conversing of
home and friends; occasionally a merry laugh would arise, as some
wag related a droll story, or, more frequently, perpetrated a practical
joke upon a comrade, until "taps" sounded, and the lights went out
as if by magic. Gradually all sounds died away, and the army was at
rest. Dreams of wife, children, and home blessed the sleeping hours
of the patient, waiting soldier, cheating him into a few minutes of
bliss.

FOOTNOTES:

[1] Although General Warren never did and probably never will be
able to arouse an army corps, in the middle of the night, from the
deep sleep that follows the exhaustion of a battle, build a bridge
thirty feet long over a brawling stream swollen by a twelve hours'
rain, and march five miles over muddy roads, in an hour from the
time he receives the order, it is quite doubtful whether more than
one general officer could be found in the United States who would
require it or imagine it could be done; and I assert that no more
efficient and patriotic officer than Warren ever wore a star.
[2] The Iron Brigade was at first composed of the Second, Sixth, and
Seventh Wisconsin, and the Nineteenth Indiana. In October, 1862,
was added the Twenty-fourth Michigan. The heaviest loss by
brigades, in the entire Union army, fell to this command.—Editor.

On the Skirmish Line


Hark! a horse comes galloping up to the Colonel's quarters, a few
hurried words are spoken, and then come the quick, sharp words of
command: "Adjutant, go to the commanding officers of companies;
tell them to have their commands under arms at once, and report
them on the parade ground in heavy marching order. Make no noise;
no drums will be beaten, nor alarms sounded."
Soon from out the darkness, upon the chill night, sounds again:
"Orderly, see that the company is at arms at once, in heavy
marching order!"
"Strike tents and pack knapsacks!" cries the orderly; and all along
the line is heard the busy stir and bustle of striking tents and
packing knapsacks, accompanied now and then by a suppressed
yawn or muttered curse from the sleepy soldier thus rudely aroused
from pleasant dreams and comfortable blankets to pack up his bed,
tear down his house, and travel he knows not, and in many cases
cares not, where. The sun next morning looked down upon a
solitude where last evening a city stood. The army is crossing the
Rapidan.
Surprised at the celerity of the movement, the enemy made but
feeble resistance at the fords, and fell back to its retrenchments at
Mine Run.
That night, weary and foot-sore, we lay waiting for the rising of the
morning sun, whose beams were to be obscured by the sulphurous
battle cloud.
Early on the morning of the 5th, we were aroused from our slumbers
by the command: "Turn out! Ten minutes to cook coffee and prepare
for marching!"
Staff officers and orderlies were galloping hither and thither, the
ammunition wagons were ordered to the front, general officers could
be seen inspecting the ground, and all those grim preparations were
being made that to the soldier were recognized as the precursor of
battle.
Soon our line was formed, and the old soldiers scarcely waited for
the order to throw up breastworks. This done, we threw ourselves
along the ground, waiting for the enemy to show themselves. But,
so far as I was concerned, alas for human expectations! At this
moment an excessively polite orderly came up to me, and, touching
his hat, said: "Captain, Colonel Bragg directs that you report with
your company to General Cutler, for skirmish duty."
Around Colonel Bragg there was a group of officers, who were
evidently pleased that this unwelcome message should have come to
some one besides themselves. Concealing my distaste for the duty
assigned me, I sent them a cheerful "Good bye! I expect you fellows
will all be wiped out before I get back."
"Good-by!" was returned. "Better 'shake' before you go, for it's the
last we'll ever see of you."
"Shake them up lively, my boy!" said the Colonel.
"Never mind me," I replied. "Look out you don't get run over by the
line of battle, when they follow me in." And so the badinage went
on. Major Plummer and Captain Converse of that merry group were
both destined to fight their last battle that day.
Upon reporting to General Cutler, I found him pacing up and down
before his quarters, evidently laboring under some excitement. I had
at one time served on his staff, and we were familiarly acquainted.
He invited me into his tent, and extending his hand said: "Captain,
your work this morning will not be play. Out in front—I do not know
exactly how far, but probably within a mile—you will find the sharp-
shooters deployed as skirmishers. You will join them. Use your own
company as you think best; take command of the line, and advance
until you raise the enemy and bring on an engagement."
Just as I was leaving him, he added, "Take along plenty of orderlies,
and report frequently."
Those of my readers who have had actual experience in skirmishing,
can readily understand how distasteful it is to the soldier. It is a duty
that furnishes the best opportunity in the world for getting "wiped
out," with but slight chance of achieving military glory. It is a duty
that requires your best efforts, all of which are sure to be
overshadowed by the more momentous events to follow, and sure to
be forgotten in the official reports.
Somewhat reluctantly, I will confess, I obeyed the order, found the
line deployed, and immediately ordered an advance.
Our progress was necessarily slow, the ground being broken and
heavily timbered with a kind of scrub pine. After advancing about a
mile, I discovered a long line of "graybacks" moving slowly forward
in line of battle, without the precaution of throwing forward a
skirmish line. My men were immediately halted, and the command to
commence firing given.
If ever a set of men were astonished, those Confederates were the
men. The nature of the ground was such that neither party saw the
other until within thirty-five or forty yards of each other. We had the
advantage. They were in line of battle, while my men were deployed
and behind trees, stumps, stones—anything that might afford
concealment and protection.
The rattling, scattered firing from my line told fearfully upon the
enemy, and they at once replied with a volley. Whew! How the
bullets sung and whistled around us! The only thing I feared was,
that they would discover our weakness and charge us, for my men
were sheltered. But the Confederates simply held their ground,
replying to our skirmish fire from line of battle.
Soon word reached headquarters of the position of the enemy, and a
cracking and roar at the rear gave notice of the advance of our line
of battle. Hurrah! Here they come on, double quick! "Cold steel,
boys! Give 'em the bayonet!" I heard General Cutler say; and over us
they came.
My own men caught the inspiration, and gladly obeyed the order to
move forward with the line. At the first shock the enemy's line was
broken. Two miles we drove them, and then the programme
changed.
In moving a long line over broken ground at double quick, intervals
are bound to occur; connections to be lost. The enemy, taking
advantage of this, had thrown a force into our rear, and bullets
began to come from behind us. At first this caused confusion, then
panic. Our line, vigorously pressed in front and rear at the same
time, became demoralized. Officers made desperate efforts to rally
the men, but it was of no use; they could not endure the bullets
coming from the front and rear at once, and away they went.
About this time I had a sensation akin to being struck by lightning.
Upon recovering consciousness, I found myself with a badly-swelled
head and great confusion of ideas, and I was bleeding profusely
from ears and nose. On all sides were the maimed, the dying, and
the dead. There was no enemy in sight save those killed and
wounded. This was consoling; but unfortunately, if I had no enemies
to fear, I was equally destitute of friends.
Which way was north, south, east, or west, I was wholly unable to
determine. I was equally at a loss to decide which was front and
which rear. Hearing firing in one direction, I came to the sage
conclusion that by going in the direction of the sound I should at
least be able to determine where our forces were.
But what was the matter with the trees? They were cutting up all
sorts of antics—advancing, retreating, bobbing up and down,
actually waltzing about me. Around and around they went, until they
made me dizzy. In trying to catch one of them, the ground suddenly
flew up into my face, and, not satisfied with that, tried to roll me off;
but I held on like a tick, grasping the twigs with all my might. The
exertion was too much, and I fainted outright. Upon recovering my
senses, I concluded to make my way to the rear. I found it difficult
to travel, however, because of the giddiness and partial blindness
caused by my wound. When I had progressed about a quarter of a
mile, I found myself looking down the barrel of a musket.

Captured
A Confederate regiment, the Thirteenth Georgia, had, in the mêlée,
become detached from its brigade, and was lost in the dense forest.
The commanding officer had ordered the men to lie down in a
thicket, and unfortunately I had surprised them. Not being in the
humor just then to "surround them," like the Irishman, I surrendered
at discretion, and was immediately disarmed and conducted to the
commander, when the following conversation took place:
Confederate Officer. Captain, were you in the skirmish line out
yonder?
Yank. I am a prisoner, sir, and must decline to answer any questions
touching our position or forces.
Confederate. That's all right, Captain, but I would like to know
whether you have any skirmishers in there. Do you know where
Gordon's brigade is?
Yank. Gordon's brigade! Why, I don't know where I am myself.
Confederate. Then there are two of us in the same fix. To tell the
truth, I am lost. I got through an interval in your lines, I think; at all
events, I found myself in your rear without knowing how I got there,
and was trying to get back when you uns run over us. We just lay
still, and the Yanks passed us.
Yank. In which direction did they go?
Confederate. Out yon.
Yank. Then it strikes me that your rear is in an opposite direction.
Confederate. Well, yes, I reckon so. Corporal, take this officer to the
rear and find the Provost Marshal and report him.

En Route to Lynchburg
I found myself traveling toward Richmond in quite different company
and under less favorable auspices than I had ever imagined would
be my lot. After running about an hour we at length found the
Provost guard of the Confederate army, and to my chagrin about
twelve hundred of my companions in misfortune. Some, like myself,
were wounded. Some expressed impatience and mortification.
Others evidently accepted their condition as inevitable and
determined to make the best of it, expressing more concern for the
success of our arms than solicitude for themselves.
At a little distance from the prison corral were the badly wounded,
awaiting the ministrations of a surgeon. There, under a large tree,
on a blanket, lay the gallant Captain Converse, a prisoner, wounded
and dying; by his side, with one leg already amputated, Corporal
Frank Hare, with cocked revolver, kept at bay a couple of the
enemy's surgeons who were desirous of experimenting upon the yet
breathing body of his leader. The heroism of those two men was
sublime. The Captain had been shot through the body and both
thighs. It was utterly impossible for him to recover. He knew that his
moments were numbered, and the end was nigh. He only asked to
be permitted to die in peace, but the surgeons were desirous of
experimenting upon him by what is known as the "hip amputation."
Converse had overheard their conversation, and directed Hare to put
his hand in a certain pocket and get his revolver, which had been
overlooked when his captors took his side-arms, and, armed with
this, to prevent them from torturing him. Hare did as his officer
directed; and when they attempted to remove his Captain he cocked
the revolver, and in quiet, yet firm tones, warned them that he
would shoot the first man that laid a hand on him. Weapons were
pointed at him, with threats to kill him if he did not surrender the
pistol. Hare only laughed at them, asking them what they supposed
he cared for life, with one leg gone?
Struck with admiration for his bravery, the guard was withdrawn. A
Confederate officer, standing near, filled with admiration of his
heroism, said, "I would like a regiment of such men!"
This aroused the dying Captain, who, his eyes flashing with patriotic
fire, told him that he had the honor to lead a hundred just such
men, and added: "The North is full of them. Sooner or later we shall
triumph, and your rebel rag will be trampled beneath their feet."
With these brave, prophetic words he breathed out his young life, a
willing sacrifice upon the altar of his country. At the instant he
expired the sun broke through a rift in the battle cloud, and glancing
down through the shimmering foliage of the forest tree, illumined
the face of the dead. I thought it the pathway of the angel that bore
aloft the released spirit of my comrade and friend.
I have seen men in the mad excitement of a charge perform reckless
deeds of bravery, facing death with apparent nonchalance, and
admired them for their soldierly bearing and courage; but this was
something different. It will be difficult to find an instance in either
ancient or modern history, of greater fidelity, love, confidence,
courage, and fearless patriotism than was displayed by these two
wounded heroes. High up on the list of those made deathless by
heroic deeds, should be inscribed the names of Captain Rollin P.
Converse and Corporal Frank Hare.
Before I witnessed the death of Converse, I had felt despondent, but
now the sight of his calm courage determined me to bear my own
lot with philosophy. As a matter of fact, I was no worse off than
thousands of others, and vastly better off than many. Even then, I
began to plan some way for escape.
A short time only was allowed us to rest and recuperate. All able to
march at all were soon en route for Orange Court House, under the
escort of a strong guard. There were several hundred of us. Among
others I recollect Colonel Grover, a gallant officer of the Seventh
Indiana. Although the distance could not have been more than eight
or ten miles, perhaps less, it was about 10 o'clock before we arrived
at our destination for the night. During the march in the darkness
several of the prisoners made their escape, but I believe that all
these were eventually recaptured.
No rations had been issued to us, and many were ready to faint from
hunger and fatigue, but the "bitter cud" of our disappointment was
all we then had to chew. So far, we had been in the hands of
soldiers, and our treatment had been as good as we had any reason
to expect. But upon our arrival at Orange Court House we were
turned over to a squint-eyed, knock-kneed Provost-Marshal and his
home guard, and with the change of guard came a most decided
change in our treatment.
Cowards are always tyrants, and this redheaded commander of the
home guard was no exception to the rule. The enlisted men were
separated from the officers and driven into a dirty back yard, where
they bivouacked quite comfortably, for they had their rubber and
woolen blankets and could on ordinary occasions sleep as well
without shelter. But they were aroused at an early hour in the
morning, and under the directions of the squint-eyed Provost
Marshal systematically robbed of their blankets, both rubber and
woolen, also their knapsacks. One poor fellow, indignant at such
robbery, tore his blanket into strips. This act being observed by the
delectable specimen of Confederate chivalry, he sprang upon him
with a club and knocked him down, striking him several blows while
he lay on the ground, senseless and bleeding. Some of our officers
remonstrated against such plain violation of civilized warfare, and
were coolly told they had better keep their sympathy to themselves,
as they would probably need it all for home consumption.
On inquiry we learned that no rations could be obtained, but were
kindly permitted to purchase from a sutler a corn-dodger and cup of
coffee each, for which we paid two dollars apiece, in greenbacks.
Soon after breakfast, we were formed in column for marching, and
started for Gordonsville.
If some of us had been with our commands, instead of being
prisoners, we probably would not have thought we could endure the
march in the hot sun. My head was badly swollen and pained me
greatly; this, together with the heat, insufficient food, and
depression of spirits consequent upon the situation, almost
unmanned me. Keep up with the column I could not. Finally, two or
three of us cripples were permitted to fall behind under the guard of
one man, and never in my life did I feel the need of money so badly,
for if we could have raised only fifty dollars in greenbacks we had
reason to believe our guard's cupidity would have easily overcome
his sense of duty. But alas! The money was not to be commanded;
so, a few rods at a time, we continued our march.
Just as it was getting dark we reached Gordonsville. Although the
distance traversed was comparatively short, yet I venture to say the
day's march will be remembered by that little squad of cripples
longer than many another of double the distance. One of the things
that discouraged us was the reports concerning the battle of the day
before, received from Confederate sources. We were informed that
our forces were in full retreat to Washington, that our loss was about
one-half our effective force, and the like.
Immediately upon our arrival at Gordonsville we were corralled in a
railroad excavation and closely guarded. The next morning we were
loaded upon freight cars, and to our surprise found that Lynchburg,
not Richmond, was our destination.
Upon this slight foundation we immediately began to build great
hopes. If we had lost the battle, what was the reason we were not
shipped to Libby and Belle Isle? We had not then heard of a great
man's famous expression, "I propose to fight it out on this line if it
takes all summer." The celebrated flank movement that placed the
army south of Richmond and bottled up the Confederate army,
existed only in the prolific brain of the greatest soldier of the age.
The Army of the Potomac had so many times marched up the hill,
only to march down again, that we began to look upon this
performance as the regular thing. We did not realize that this army
was then under the guidance of a man who knew no such word as
fail; who, if whipped on one day, only fought harder the next.
Our trip to Lynchburg was relieved of its monotony by one
circumstance. The bottom of one of the cars was mined, a plank was
cut out, and when a halt was made to take on wood and water, one
or two adventurous fellows crawled through and dug the dirt from
between two of the ties, so as to allow them room to escape
collision with the bottom of the cars, lying there while the train
passed over them. The ruse was successful, so far as escaping from
the train was concerned; but unfortunately the fugitives were
discovered as soon as the train passed by, and recaptured. The
attempt was a foolish one, but indicative of the general disposition
to attempt any manner of escape that had the slightest chance for
success.

Arrival at Lynchburg
The next morning we arrived at Lynchburg, and were taken from the
cars. Here occurred a ludicrous scene, that, notwithstanding their
situation, furnished our boys a hearty laugh. Some philosopher has
said, "Man is an animal that laughs." Man is the only animal that
laughs. This, as distinctly as speech, marks the distinction between
reasoning beings and brute instinct. Show me a man who never
laughs, and I will show you one whose instincts are brutish and
cruel. These thousands or more prisoners, surrounded by enemies,
cut off from all that makes life endurable, deprived of liberty,
laughed heartily, and it did them good.
A militia company had been improvised to act as our guard and
escort us from the cars to the prison. They were not uniformed,
being dressed in everything from swallow-tailed coats and slippers to
home-spun butternut, and armed with everything that could shoot,
from a carbine to a flint-lock musket. The members were of all ages,
from school boys to decrepit old men. They were commanded by a
young fellow in a nondescript uniform. His sword and scabbard were
the only really soldierly things about him, and were handled about
as awkwardly as we had handled ours, when first transformed from
citizens into officers, two or three years before.
This amateur officer wanted the prisoners formed into four ranks,
faced in the proper direction, but how to do it was a problem to him.
After several abortive attempts, our folks obeying every order
strictly, which only demonstrated the fact that his orders failed to
convey his meaning, he at last lost patience and roared out: "G——
d—— it! I want you Yanks to git in four ranks, faced yon way!"
This direction, though not in strict accordance with military parlance,
was at least intelligible; and after much pulling and hauling, the
desired result was accomplished, every man merrily repeating the
order, and pushing and pulling his fellows. Then he attempted to
form his guard on either flank of the column. He had great difficulty
in bringing this about, for our boys insisted on obeying every order
given to the guard. At last, out of patience with us, he exclaimed:
"See here! I want you Yanks to stand still, when I give orders! I'm
speaking to the company, not you uns!"
When at length he had formed the order of march, he commanded,
"Forward, march!" The guard started, and we stood still. This was
not observed until about half of the guard had passed us. This
necessitated a halt, and he then explained that now he wanted us to
"git up along with the balance."
Thus, laughing and jesting, we passed up the street and into our
first prison pen, an old tobacco warehouse situated on the principal
street, but rather small for the company it was expected to
entertain. Here we commenced our prison life.
Attached to the building was a small yard, which at certain hours we
were permitted to visit, for the purpose of supplying ourselves with
water, washing clothes, exercise, etc. Our prison proper was a room
about twenty by fifty feet. Into this space were crowded nearly two
hundred officers; for prior to this time the enlisted men had been
separated from us, while additions of officers from other sources had
been added to our squad.

Treatment at Lynchburg
The floors of the building were filthy, and the ceilings swarmed with
vermin. The only ventilation was from two windows at one end of
the room. The building was only a fit habitation for the rats that
infested it. Very few of us had blankets, and none were issued to us.
At night we were obliged to lie on the floor, so closely packed that
every inch of space was occupied; and if necessity required one to
leave the room during the night, he was compelled to travel over his
comrades to accomplish his purpose. Before morning the air would
become almost poisonous, through lack of ventilation.
Our rations here consisted of bread and a small quantity of meat.
They were good in quality, although rather limited in quantity; but
our experience as soldiers, sometimes on short rations, would have
accustomed us to such hardships, if we could only have divested
ourselves of the intense longing for liberty. Compared with other
Southern prisons, our condition here was quite tolerable.
The officer in command of this prison was humane. Only once did he
show any temper, and that was one night when we all began to sing
patriotic songs, ending with "Old John Brown." When we got to
"We'll hang Jeff Davis on a sour apple tree."

he came into the room and ordered us to stop singing; but we only
sang the louder, telling him that our tongues were our own, and we
should sing if we wanted to.
"Well," he replied, "sing, if you will, but you shan't eat, for I'll stop
your rations."
This had the desired effect. Our sonorous chorus soon sank to a
feeble quaver and faded away. Some of us consoled ourselves with
the memory of one occasion when the Iron Brigade entered
Warrenton, every man singing "John Brown," the column keeping
time to the music. But we did not sing any more on this occasion.
For a time we kept up our courage by cheerful conversation or
practical jokes. Sometimes an amusing incident would serve to break
the monotony, and was eagerly seized upon and made the most of.
Many obtained nick-names, such as "Lengthy," "Shorty,"
"Whitehead," etc. One, a Lieutenant Wetterville, obtained the
nickname of "Rats" in this way: One night, after all had retired, and
the cheerful snore began to enliven the sleepless hours of the
restless, this young officer was roused from his slumbers by a huge
rat gnawing his toes. He sprang to his feet in affright, and ran the
length of the room, shouting: "Rats! Rats!" arousing all the sleepers,
to the indignation of some and the mirth of others. The scene ended
with three cheers and a tiger, for "Rats." This light-heartedness was
but the foam on the surface, and only ill concealed the troubled
under-current that was gradually mining away the better feelings of
our natures.
The mind of man is so constituted that he cannot be deprived of his
liberty for any considerable time, without there being generated an
inordinate desire to be free. Actual physical ills become secondary to
this acute desire:
"The wish which ages have not yet subdued,
In man to have no master but his mood."

This feeling at length becomes morbid, the gay laugh becomes


hollow and forced, the eye loses its fire, and a hopeless expression
settles over the countenance like a pall.
The novelty of our situation had not yet worn away. We had been
comparatively well treated, and, besides, we were planning an
escape. Some negroes had contrived to communicate with us, and
through them we had concocted a scheme for crossing the river. We
had started a tunnel out of the yard from a closet, and were to be
harbored by a negro family until we could procure some Confederate
clothing. Two of the prisoners had formed the acquaintance of some
women by talking through the fence, and through them had secured
a suit of Confederate clothes. Clad in these, they had boldly walked
out past the guards in open daylight, escaped across the river, and
never were recaptured.

At Danville
Before we had perfected our tunnel, we were removed to Danville.
There we were confined in a two-storied brick building that had
been used as a prison for deserters, and was filthy beyond
description. The floors were covered with dirt and grease, and
literally swarmed with vermin. Our rations here, consisted of pea
soup and corn bread. Such bread, and such soup! The very
recollection is nauseating. Guards were stationed around the
building, with orders to shoot any person seen looking out of the
windows. The first knowledge we had of the existence of such an
order was, by a bullet whistling through the room, and grazing an
officer's head. The official in charge of the prison apologized for this
occurrence, telling us that he had forgotten to notify us of the
standing order given the guard, a slight omission that might have
proved fatal to some of us.

Removed to Macon
We remained here but a few days, when we were again packed in
freight cars and started for Macon, Georgia. Every change in our
place of imprisonment thus far had been for the worse, yet we
hailed this news almost with rapture. We thought, poor fools! that
anything was better than our present situation. Alas! We had not yet
tasted the dregs of the bitter draught before us. We had not
conceived the idea that such a brute as "Hog Winder" could exist, or
that men wearing the human form could be so debased as to serve
as the willing agents of such a demon. We had not even heard the
names of Tabb and Wirz. We were then miserably dirty, covered with
vermin, and half starved; but we had yet to learn the horrors of
starvation.
Happily ignorant of the future, we gladly started for our new
destination. A rumor of an exchange in progress filled us with new
hope, and although standing room was scarce and a chance to sit
down at a premium in our crowded cars—seventy-five men being
packed into each small-sized freight car—once more the song and
jest went round. We could even laugh, as we told and retold each
other that we should certainly be exchanged now; the more
sanguine being sure that we were even then on the way to a general
rendezvous established on the coast for that purpose.
While the train halted at Augusta to take on wood, a crowd gathered
around to see the show—among others a boy about twelve years
old, who carried a large market basket filled with sandwiches. We
looked longingly at the food and tried to purchase, but he refused to
sell to "Yanks," and the guard seemed highly pleased at his spirit,
allowing him to approach near to the train.
Ours was the last car, and he lingered around the rear of it, talking
with us, always in the most defiant manner; only it seemed to me
that his countenance did not denote him to be the ferocious rebel
his language seemed to indicate, and I could not help thinking it
strange that he should refuse to sell to the guards, who tried to buy
of him. At last the train began to move. He waited until we were
fairly under way, then tossed the basket to us and ran back into the
crowd.
In the basket was a note from his mother, a Union woman, filled
with brave, hopeful words, saying that she trusted to the native
shrewdness of her son to secure to us her offering. The note was
handed round, and many a thankful heart blessed that woman, not
so much for the timely offering of food, as for the words of
sympathy and kindness that accompanied the gift.
After a long and exceedingly tiresome journey, we arrived at Macon.
I can not even now repress a shudder as I pronounce that name. It
is associated in my mind with suffering, misery, starvation, death.
Near a beautiful grove of trees, about twenty rods from the railroad,
was an enclosure of about five acres, nearly square in form,
surrounded by a fence constructed of pine boards twelve feet long,
fastened perpendicularly to rails in the same manner we sometimes
see tight-board-fences made in the North. Four feet from the top, on
the outside, a walk was constructed. On this sentinels were
stationed at intervals of about fifty feet. Near the entrance, on the
outside, was the office of the commander of the prison, a small
wooden structure.
Upon our arrival we were passed into the office, one at a time, and
from there into the prison yard. We could not imagine why so much
caution should be used in passing us in. Some suspected that the
Provost Marshal wanted to examine our passports. At length my turn
came, and I passed in. Before me stood a thing in uniform. I cannot
describe his personal appearance. Imagine, if you can, an
excessively vicious baboon, dressed in gray, half drunk, and you
have him—Captain Tabb!
Upon my entrance he looked me over and observed to a
subordinate, "No pickin's here!" Then he walked up to me, and with
the dexterity of an expert pickpocket inserted his hands in my
pockets. He seemed intuitively to know the exact location of each
one. If my life had depended on keeping silence, I could not have
refrained from telling him, as I did, when he found nothing to
reward his industry, that another thief had forestalled him.
I expected that he would be very angry at hearing this, but he only
laughed, remarking: "I kind o' reck'ned from your looks that you'd
been cleaned out. You can git." Filled with indignation and disgust, I
left his presence, and was ushered into the Macon prison pen.

The Prison Pen


What a sight! Who were these gaunt skeletons, clothed with rags,
covered with dirt, who crowded up to the gate, yelling, "Fresh fish!
Fresh fish!" Long skeleton fingers were already inserted into our
haversacks, eagerly searching for the crumbs at the bottom; wild,
eager eyes were peering into our faces—eyes from which had
departed all expression except that of hopeless misery.
One pressed through the crowd and called me by name, and
listlessly held out his hand. I looked at him in astonishment. There
was not a feature that I could recognize. His hair and beard were
long and neglected, he was barefooted, a coarse blue shirt and a
pair of overalls were his only clothing. The expression of his face,
like that of his companions, was indescribable. It mirrored the soul
of a man from whom hope had forever departed.
"I don't know you!" I cried in horror.
He laughed a bitter, mocking laugh. "I used to be Captain Rollins,"
he said.

You might also like