(Ebook) Mastering Unix Shell Scripting: Bash, Bourne, and Korn Shell Scripting for Programmers, System Administrators, and UNIX Gurus, Second Edition by Randal K. Michael ISBN 9780470183014, 0470183012 - Download the ebook now for instant access to all chapters
(Ebook) Mastering Unix Shell Scripting: Bash, Bourne, and Korn Shell Scripting for Programmers, System Administrators, and UNIX Gurus, Second Edition by Randal K. Michael ISBN 9780470183014, 0470183012 - Download the ebook now for instant access to all chapters
https://ebooknice.com/product/biota-grow-2c-gather-2c-cook-6661374
https://ebooknice.com/product/mastering-unix-shell-scripting-979818
https://ebooknice.com/product/matematik-5000-kurs-2c-larobok-23848312
https://ebooknice.com/product/sat-ii-success-
math-1c-and-2c-2002-peterson-s-sat-ii-success-1722018
(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
(Ebook) Master SAT II Math 1c and 2c 4th ed (Arco Master the SAT
Subject Test: Math Levels 1 & 2) by Arco ISBN 9780768923049,
0768923042
https://ebooknice.com/product/master-sat-ii-math-1c-and-2c-4th-ed-
arco-master-the-sat-subject-test-math-levels-1-2-2326094
https://ebooknice.com/product/mastering-linux-shell-scripting-a-
practical-guide-to-linux-command-line-bash-scripting-and-shell-
programming-11145962
https://ebooknice.com/product/learning-the-bash-shell-unix-shell-
programming-1565756
Michael ffirs.tex V2 - 03/24/2008 4:19pm Page iii
®
Mastering UNIX Shell
Scripting
Randal K. Michael
Mastering UNIX®Shell
Download from Wow! eBook <www.wowebook.com>
Scripting
Second Edition
Michael ffirs.tex V2 - 03/24/2008 4:19pm Page ii
Michael ffirs.tex V2 - 03/24/2008 4:19pm Page iii
®
Mastering UNIX Shell
Scripting
Randal K. Michael
Mastering UNIX®Shell Scripting: Bash, Bourne, and Korn Shell Scripting for
Programmers, System Administrators, and UNIX Gurus, Second Edition
Published by
Wiley Publishing, Inc.
10475 Crosspoint Boulevard
Indianapolis, IN 46256
www.wiley.com
Copyright © 2008 by Randal K. Michael
Published by Wiley Publishing, Inc., Indianapolis, Indiana
Published simultaneously in Canada
ISBN: 978-0-470-18301-4
Manufactured in the United States of America
10 9 8 7 6 5 4 3 2 1
No part of this publication may be reproduced, stored in a retrieval system or transmitted
in any form or by any means, electronic, mechanical, photocopying, recording, scanning or
otherwise, except as permitted under Sections 107 or 108 of the 1976 United States
Copyright Act, without either the prior written permission of the Publisher, or
authorization through payment of the appropriate per-copy fee to the Copyright
Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978)
646-8600. Requests to the Publisher for permission should be addressed to the Legal
Department, Wiley Publishing, Inc., 10475 Crosspoint Blvd., Indianapolis, IN 46256, (317)
572-3447, fax (317) 572-4355, or online at http://www.wiley.com/go/permissions.
Limit of Liability/Disclaimer of Warranty: The publisher and the author make no
representations or warranties with respect to the accuracy or completeness of the contents
of this work and specifically disclaim all warranties, including without limitation
warranties of fitness for a particular purpose. No warranty may be created or extended by
sales or promotional materials. The advice and strategies contained herein may not be
suitable for every situation. This work is sold with the understanding that the publisher is
not engaged in rendering legal, accounting, or other professional services. If professional
assistance is required, the services of a competent professional person should be sought.
Neither the publisher nor the author shall be liable for damages arising herefrom. The fact
that an organization or Website is referred to in this work as a citation and/or a potential
source of further information does not mean that the author or the publisher endorses the
information the organization or Website may provide or recommendations it may make.
Further, readers should be aware that Internet Websites listed in this work may have
changed or disappeared between when this work was written and when it is read.
For general information on our other products and services or to obtain technical support,
please contact our Customer Care Department within the U.S. at (800) 762-2974, outside
the U.S. at (317) 572-3993 or fax (317) 572-4002.
Library of Congress Cataloging-in-Publication Data is available from publisher.
Trademarks: Wiley, the Wiley logo, and related trade dress are trademarks or registered
trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other
countries, and may not be used without written permission. UNIX is a registered
trademark of The Open Group. All other trademarks are the property of their respective
owners. Wiley Publishing, Inc., is not associated with any product or vendor mentioned in
this book.
Wiley also publishes its books in a variety of electronic formats. Some content that appears
in print may not be available in electronic books.
Michael ffirs.tex V2 - 03/24/2008 4:19pm Page v
This book is dedicated to my wife Robin, the girls, Andrea and Ana, and
the grandchildren, Gavin, Jocelyn, and Julia — my true inspiration.
Michael ffirs.tex V2 - 03/24/2008 4:19pm Page vi
Michael fabout.tex V1 - 03/24/2008 4:34pm Page vii
vii
Michael fabout.tex V1 - 03/24/2008 4:34pm Page viii
Michael fcre.tex V1 - 03/24/2008 4:35pm Page ix
Credits
ix
Michael fcre.tex V1 - 03/24/2008 4:35pm Page x
Michael ftoc.tex V3 - 03/24/2008 4:38pm Page xi
Contents
Acknowledgments xxv
Introduction xxvii
xi
Michael ftoc.tex V3 - 03/24/2008 4:38pm Page xii
xii Contents
Contents xiii
xiv Contents
Contents xv
xvi Contents
Contents xvii
xviii Contents
Moreover, for the reasonable world, its words, and acts, and
speculations,
For frail and fallen manhood, in his every work and way,
Beauty, wrecked and stricken, lingereth still among us,
And morsels of that shattered sun are dropt upon the darkness.
Yea, with savages and boors, the mean, the cruel, and besotted,
Ever in extenuating grace hide some relics of the beautiful.
Gleams of kindness, deeds of courage, patience, justice, generosity,
Truth welcomed, knowledge prized, rebukes taken with contrition,
All, in various measure, have been blest with some of these,
And never yet hath lived the man, utterly beggared of the beautiful.
Ajax may rout a phalanx, but beauty shall enslave him single-handed;
Pericles ruled Athens, yet he is the servant of Aspasia:
Light were the labour, and often-told the tale, to count the victories
of beauty,—
Helen, and Judith, and Omphale, and Thais, many a trophied name.
At a glance the misanthrope was softened, and repented of his vows,
When Beauty asked, he gave, and banned her—with a blessing;
The cold ascetic loved the smile that lit his dismal cell,
And kindly stayed her step, and wept when she departed;
The bigot abbess felt her heart gush with a mother's feeling,
When looking on some lovely face beneath the cloister's shade;
Usury freed her without ransom; the buccaneer was gentle in her
presence;
Madness kissed her on the cheek, and Idiotcy brightened at her
coming:
Yea, the very cattle in the field, and hungry prowlers of the forest
With fawning homage greeted her, as Beauty glided by.
A welcome guest unbidden, she is dear to every hearth;
A glad spontaneous growth of friends is springing round her rest:
Learning sitteth at her feet, and Idleness laboureth to please her,
Folly hath flung aside his bells, and leaden Dulness gloweth;
Prudence is rash in her defence; Frugality filleth her with riches;
Despair came to her for counsel; and Bereavement was glad when
she consoled;
Justice putteth up his sword at the tear of supplicating beauty,
And Mercy, with indulgent haste, hath pardoned beauty's sin.
For beauty is the substitute for all things, satisfying every absence,
The rich delirious cup to make all else forgotten:
She also is the zest unto all things, enhancing every presence,
The rare and precious ambergris, to quicken each perfume.
O beauty, thou art eloquent; yea, though slow of tongue,
Thy breast, fair Phryne, pleaded well before the dazzled judge:
O beauty, thou art wise; yea, though teaching falsely,
Sages listen, sweet Corinna, to commend thy lips;
O beauty, thou art ruler; yea, though lowly as a slave,
Myrrha, that imperial brow is monarch of thy lord;
O beauty, thou art winner; yea, though halting in the race,
Hippodame, Camilla, Atalanta,—in gracefulness ye fascinate your
umpires;
O beauty, thou art rich; yea, though clad in russet,
Attalus cannot boast his gold against the wealth of beauty;
O beauty, thou art noble; yea, though Esther be an exile,
Set her up on high, ye kings, and bow before the majesty of beauty!
Friend and scholar, who, in charity, hast walked with me thus far,
We have wandered in a wilderness of sweets, tracking beauty's
footsteps:
And ever as we rambled on among the tangled thicket,
Many a startled thought hath tempted further roaming:
Passion, sympathetic influence, might of imaginary haloes,—
Many the like would lure aside, to hunt their wayward themes.
And, look you!—from his ferny bed in yonder hazel coppice,
A dappled hart hath flung aside the boughs and broke away;
He is fleet and capricious as the zephyr, and with exulting bounds
Hieth down a turfy lane between the sounding woods;
His neck is garlanded with flowers, his antlers hung with chaplets,
And rainbow-coloured ribbons stream adown his mottled flanks:
Should we follow?—foolish hunters, thus to chase afoot,—
Who can track the airy speed and doubling wiles of Taste?
For the estimates of human beauty, dependent upon time and clime,
Manifold and changeable, are multiplied the more by strange
gregarious fashion:
And notable ensamples in the great turn to epidemics in the lower,
So that a nation's taste shall vary with its rulers.
Stern Egypt, humbled to the Greek, fancied softer idols;
Greece, the Roman province, nigh forgat her classic sculpture;
Rome, crushed beneath the Goth, loved his barbarian habits;
And Alaric, with his ruffian horde, is tamed by silken Rome.
Columbia's flattened head, and China's crumpled feet,—
The civilized tapering waist,—and the pendulous ears of the savage,
—
The swollen throat among the mountains, and an ebon skin beneath
the tropics,—
These shall all be reckoned beauty: and for weighty cause.
First, for the latter: Providence in mercy tempereth taste by
circumstance,
So that Nature's must shall hit her creature's liking;
Second, for the middle: though the foolishness of vanity seek to mar
proportion,
Still, defects in those we love shall soon be counted praise;
Third, for the first: a chief, and a princess, maimed or distorted from
the cradle
Shall coax the flattery of slaves to imitate the great in their
deformity:
Hence groweth habit: and habits make a taste,
And so shall servile zeal deface the types of beauty.
Whiles Alexander conquered, crookedness was comely:
And followers learn to praise the scars upon their leader's brow.
Youth hath sought to flatter age by mimicking grey hairs;
Age plastereth her wrinkles, and is painted in the ruddiness of Youth.
Fashion, the parasite of Rank, apeth faults and failings,
Until the general Taste depraved hath warped its sense of beauty.
Each man hath a measure for himself, yet all shall coincide in much;
A perfect form of human grace would captivate the world:
Be it manhood's lustre, or the loveliness of woman, all would own its
beauty,
The Caffre and Circassian, Russians and Hindoos, the Briton, the Turk
and Japanese.
Not all alike, nor all at once, but each in proportion to intelligence,
His purer state in morals, and a lesser grade in guilt:
For the high standard of the beautiful is fixed in Reason's forum,
And sins, and customs, and caprice, have failed to break it down:
And reason's standard for the creature pointeth three perfections,
Frame, knowledge, and the feeling heart, well and kindly mingled;
A fair dwelling, furnished wisely, with a gentle tenant in it,—
This is the glory of humanity: thou hast seen it seldom.
Yet is this the pleasing trickery, that cheateth half the world,
Nature's wise deceit to make up waste in life;
And few be they that rest uncaught, for many a twig is limed;
Where is the wise among a million, that took not form for beauty?
But watch it well; for vanity and sin, malice, hate, suspicion,
Louring as clouds upon the countenance, will disenchant its charms.
The needful complexity of beauty claimeth mind and soul,
Though many coins of foul alloy pass current for the true:
And albeit fairness in the creature shall often co-exist with
excellence,
Yet hath many an angel shape been tenanted by fiends.
A man, spiritually keen, shall detect in surface beauty
Those marring specks of evil which the sensual cannot see;
Therefore is he proof against a face, unlovely to his likings,
And common minds shall scorn the taste, that shrunk from sin's
distortion.
And there is a beauty for the spirit; mind in its perfect flowering,
Fragrant, expanded into soul, full of love and blessed.
Go to some squalid couch, some famishing death-bed of the poor;
He is shrunken, cadaverous, diseased;—there is here no beauty of
the body:
Never hath he fed on knowledge, nor drank at the streams of
science,
He is of the common herd, illiterate;—there is here no beauty of the
reason:
But lo! his filming eye is bright with love from heaven,
In every look it beameth praise, as worshipping with seraphs;
What honeycomb is hived upon his lips, eloquent of gratitude and
prayer,—
What triumph shrined serene upon that clammy brow,
What glory flickering transparent under those thin cheeks,—
What beauty in his face!—Is it not the face of an angel?
OF FAME.
LOW the trumpet, spread the wing, fling thy scroll upon the sky,
Rouse the slumbering world, O Fame, and fill the sphere with echo!
—Beneath thy blast they wake, and murmurs come
hoarsely on the wind,
And flashing eyes and bristling hands proclaim they hear
thy message:
Rolling and surging as a sea, that upturned flood of faces
Hasteneth with its million tongues to spread the wondrous
tale;
The hum of added voices groweth to the roaring of a
cataract,
And rapidly from wave to wave is tossed that exaggerated story,
Until those stunning clamours, gradually diluted in the distance,
Sink ashamed, and shrink afraid of noise, and die away.
Then brooding Silence, forth from his hollow caverns,
Cloaked and cowled, and gliding along, a cold and stealthy shadow,
Once more is mingled with the multitude, whispering as he walketh,
And hushing all their eager ears, to hear some newer Fame.
So all is still again; but nothing of the past hath been forgotten;
A stirring recollection of the trumpet ringeth in the hearts of men:
And each one, either envious or admiring, hath wished the chance
were his
To fill as thus the startled world with fame, or fear, or wonder.
This lit thy torch of sacrilege, Ephesian Eratostratus;
This dug thy living grave, Pythagoras, the traveller from Hadës;
For this, dived Empedocles into Etna's fiery whirlpool;
For this, conquerors, regicides, and rebels, have dared their perilous
crimes.
In all men, from the monarch to the menial, lurketh lust of fame:
The savage and the sage alike regard their labours proudly:
Yea, in death, the glazing eye is illumined by the hope of reputation,
And the stricken warrior is glad, that his wounds are salved with
glory.
Smoking flax will breed a flame, and the flame may illuminate a world;
Where is he who scorned that smoke as foul and murky vapour?
The village stream swelled to a river, and the river was a kingdom's
wealth,
Where is he who boasted he could step across that stream?
Such are the beginnings of the famous: little in the judgment of their
peers,
The juster verdict of posterity shall fix them in the orbits of the
Great.
Therefore dull Zoilus, clamouring ascendant of the hour,
Will soon be fain to hide his hate, and bury up his bitterness for
shame:
Therefore mocking Momus, offended at the footsteps of Beauty,
Shall win the prize of his presumption, and be hooted from his throne
among the stars.
For, as the shadow of a mountain lengtheneth before the setting sun,
Until that screening Alp have darkened all the canton,—
So, Fame groweth to its great ones; their images loom longer in
departing;
But the shadow of mind is light, and earth is filled with its glory.
OF FLATTERY.
USIC is commended of the deaf:—but is that praise
despised?
I trow not: with flattered soul the musician heard him
gladly.
Beauty is commended of the blind:—but is that compliment
misliking?
I trow not: though false and insincere, woman listened
greedily.
Vacant Folly talketh high of Learning's deepest reason:
Is she hated for her hollowness?—learning held her wiser for the
nonce.
The worldly and the sensual, to gain some end, did homage to
religion:
And the good man gave thanks as for a convert, where others saw
the hypocrite.
Yet none of these were cheated at the heart, nor steadily believed
those flatteries;
They feared the core was rotten, while they hoped the skin was
sound:
But the fruits have so sweet fragrance, and are verily so pleasant to
the eyes,
It were an ungracious disenchantment to find them apples of Sodom.
So they laboured to think all honest, winking hard with both their
eyes;
And hushed up every whisper that could prove that praise absurd:
They willingly regard not the infirmities that make such worship vain,
And palliate to their own fond hearts the faults they will not see.
For the idol rejoiceth in his incense, and loveth not to shame his
suppliants,
Should he seek to find them false, his honours die with theirs:
An offering is welcome for its own sake, set aside the giver,
And praise is precious to a man, though uttered by the parrot or the
mocking-bird.
Come, I would forewarn thee and forearm thee; for keen are the
weapons of his warfare;
And, while my soul hath scorned him, I have watched his skill from
far.
His thoughts are full of guile, deceitfully combining contrarieties,
And when he doeth battle in a man, he is leagued with traitorous
Self-love.
Strange things have I noted, and opposite to common fancy;
We leave the open surface, and would plumb the secret depths.
For he will magnify a lover, even to disparaging his mistress;
So much wisdom, goodness, grace,—and all to be enslaved?
Till the Narcissus, self-enamoured, whelmed in floods of flattery,
Is cheated from the constancy and fervency of love by friendship's
subtle praise.
Moreover, he will glorify a parent, even to the censure of his child,—
O degenerate scion, of a stock so excellent and noble!
Scant will he be in well-earned praise of a son before his father;
And rarely commendeth to a mother her daughter's budding beauty:
Yet shall he extol the daughter to her father, and be warm about the
son before his mother;
Knowing that self-love entereth not, to resist applause with
jealousies.
Wisely is he sparing of hyperbole where vehemence of praise would
humble,
For many a father liketh ill to be counted second to his son:
And shrewdly the flatterer hath reckoned on a self still lurking in the
mother,
When his tongue was slow to speak of graces in the daughter.
But if he descend a generation, to the grandsire his talk is of the
grandson,
Because in such high praise he hideth the honours of the son;
And the daughter of a daughter may well exceed, in beauty, love,
and learning,
For unconsciously old age perceived—she cannot be my rival.
These are of the deep things of flattery: and many a shallow
sycophant
Hath marvelled ill that praise of children seldom won their parents.
This therefore note, unto detection: flattery can sneer as well as
smile;
And a master in the craft wotteth well, that his oblique thrust is
surest.
Oftimes to the sluggard and the dull, flattery hath done good service,
Quickening the mind to emulation, and encouraging the heart that
failed.
Even so, a stimulating poison, wisely tendered by the leech,
Shall speed the pulse, and rally life, and cheat astonished death.
For, as a timid swimmer ventureth afloat with bladders,
Until self-confidence and growth of skill have made him spurn their
aid,
Thus commendation may be prudent, where a child hath ill deserved
it;
But praise unmerited is flattery, and the cure will bring its cares:
For thy son may find thee out, and thou shalt rue the remedy:
Yea, rather, where thou canst not praise, be honest in rebuke.
Flatterer, thou shalt rue thy trade, though it have many present
gains;
Those varnished wares may sell apace, yet shall they spoil thy credit.
Thine is the intoxicating cup, which whoso drinketh it shall nauseate:
Thine is trickery and cheating; but deception never pleased for long.
And though while fresh thy fragrance seemed even as the dews of
charity,
Yet afterward it fouled thy censer, as with savour of stale smoke.
For the great mind detected thee at once, answering thine emptiness
with pity,
He saw thy self-interested zeal, and was not cozened by vain-glory:
And the little mind is bloated with the praise, scorning him who gave
it,
A fool shall turn to be thy tyrant, an thou hast dubbed him great:
And the medium mind of common men, loving first thy music,
After, when the harmonies are done, shall feel small comfort in their
echoes;
For either he shall know thee false, conscious of contrary deservings,
And, hating thee for falsehood, soon will scorn himself for truth,
Or, if in aught to toilsome merit honest praise be due,
Though for a season, belike, his weakness hath been raptured at thy
witching,
Shall he not speedily perceive, to the vexing of his disappointed
spirit,
That thine exaggerated tongue hath robbed him of fair fame?
Thou hast paid in forger's coins, and he had earned true money:
For the substance of just praise, thou hast put him off with shadows
of the sycophant:
Thou art all things to all men, for ends false and selfish,
Therefore shalt be nothing unto any one, when those thine ends are
seen.
Know thyself, thine evil as thy good, and flattery shall not harm thee:
Yea, her speech shall be a warning, a humbling and a guide.
For wherein thou lackest most, there chiefly will the sycophant
commend thee,
And then most warmly will congratulate, when a man hath least
deserved.
Behold, she is doubly a traitor; and will underrate her victim's best,
That, to the comforting of conscience, she may plead his worse for
better.
What then is the marvel or the shame, if units be lost among the
million?
Canst thou reasonably murmur, if a leaf drop off unnoticed?
Wondrous in architecture, intricate and beautiful, delicately tinged
and scented,
Exquisite of feeling and mysterious in life, none cared for its growth,
or its decay:
None? yea,—no one of its fellows,—nor cedar, palm, nor bramble,—
None? its twin-born brother scarcely missed it from the spray:
None?—if none indeed, then man's neglect were bitterness;
And Life a land without a sun, a globe without a God!
Yea, flowers in the desert, there be that love your beauty;
Yea, jewels in the sea, there be that prize your brightness;
Children of unmerited oblivion, there be that watch and woo you,
And many tend your sweets, with gentle ministering care:
Thronging spirits of the happy, and the ever-present Good One
Yearning seek those precious things, man hath not heart to love,
Gems of the humblest or the highest, pure and patient in their kind,
The souls unhardened by ill usage, and uncorrupt by luxury.
And ye, poor desolates unsunned, toilers in the dark damp mine,
Wearied daughters of oppression, crushed beneath the car of
avarice,
There be that count your tears,—He hath numbered the hairs of thy
head,—
There be that can forgive your ill, with kind considerate pity:
Count ye this for comfort, Justice hath her balances,
And yet another world can compensate for all:
The daily martyrdom of patience shall not be wanting of reward;
Duty is a prickly shrub, but its flower will be happiness and glory.
Ye too, the friendless, yet dependent, that find nor home nor lover,
Sad imprisoned hearts, captive to the net of circumstance,—
And ye, too harshly judged, noble unappreciated intellects,
Who, capable of highest, lowlier fix your just ambition in content,—
And chiefest, ye, famished infants of the poor, toiling for your
parents' bread,
Tired, and sore, and uncomforted the while, for want of love and
learning,
Who struggle with the pitiless machine in dull continuous conflict,
Tasked by iron men, who care for nothing but your labour,—
Be ye long-suffering and courageous: abide the will of Heaven;
God is on your side; all things are tenderly remembered:
His servants here shall help you; and where those fail you through
Neglect,
His kingdom still hath time and space for ample discriminative
Justice:
Yea, though utterly on this bad earth ye lose both right and mercy,
The tears that we forgat to note, our God shall wipe away.
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