Mastering Linux Shell Scripting a practical guide to Linux command line Bash scripting and Shell programming Ebrahim - Download the ebook now and read anytime, anywhere
Mastering Linux Shell Scripting a practical guide to Linux command line Bash scripting and Shell programming Ebrahim - Download the ebook now and read anytime, anywhere
com
https://textbookfull.com/product/mastering-linux-shell-
scripting-a-practical-guide-to-linux-command-line-bash-
scripting-and-shell-programming-ebrahim/
OR CLICK HERE
DOWLOAD EBOOK
https://textbookfull.com/product/linux-shell-scripting-cookbook-third-
edition-clif-flynt/
textbookfull.com
https://textbookfull.com/product/bash-script-linux-command-line-
reference-1st-edition-aditya-tiwari/
textbookfull.com
https://textbookfull.com/product/shell-programming-in-unix-linux-and-
os-x-stephen-g-kochan/
textbookfull.com
The Linux Command Line: A Complete Introduction 2nd
Edition William E. Shotts
https://textbookfull.com/product/the-linux-command-line-a-complete-
introduction-2nd-edition-william-e-shotts/
textbookfull.com
https://textbookfull.com/product/linux-basics-for-hackers-getting-
started-with-networking-scripting-and-security-in-kali-occupytheweb/
textbookfull.com
https://textbookfull.com/product/wicked-cool-shell-
scripts-101-scripts-for-linux-os-x-and-unix-systems-dave-taylor/
textbookfull.com
https://textbookfull.com/product/computing-with-the-raspberry-pi-
command-line-and-gui-linux-1st-edition-brian-schell/
textbookfull.com
https://textbookfull.com/product/linux-basics-for-hackers-getting-
started-with-networking-scripting-and-security-in-kali-1st-edition-
occupytheweb/
textbookfull.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.
At Medhe in the Roha taluka of the Kolába District, the following methods
are in vogue for the cure of barrenness:—
(2) To worship the god Ganpati and to observe fasts on Sankasthi chaturthi,
i.e., the fourth day of the dark half of every month.
(3) To walk round the temple of Máruti and Pipal and Umbar trees every
day, in the morning.67
At Shirgaon in the Máhim taluka of the Thána District, it is said that the
repetition of the mantra “Santán Gopál jáy” is resorted to as a cure for
barrenness.70
At Wáde in the Thána District, women make vows even to minor deities
such as Chedoba to get rid of barrenness. They also use copper amulets and
cotton strings procured from a sorcerer well versed in the use of mantras.71
At Dahigaon in the Thána District the worship of the god Shri Satya
Náráyan is held to cure barrenness. Some women also distribute to the poor
jágri equal to the weight of a child.72
At Dehari in the Murbád taluka of the Thána District, the village deity
Dehari Máta is invoked and worshipped by women for the cure of
barrenness.73 In the Kolhápur District, the help of the family deities and of
the household deities is invoked. Women take turns round the Banyan,
Pipal and Umbar, trees. Some make vows to the gods, and perform certain
propitiatory rites as well as the Náráyan Nágabali. It is believed that the
children do not live long if a member of the family has killed a snake, or if
the funeral rites of a person in the family have remained unperformed. The
following ceremony is known as Náráyan Nágabali. A snake is made from
the flour of Rála (panie seed), and another made of gold is put into it. It is
then burnt like a dead body. All the ordinary funeral rites are performed.
After performing the eleventh day rites, homa, i.e., sacred fire, is kindled at
night time, and after keeping vigil for the whole night, milk and a dakshana
are given to Bráhmans. A feast is given to eleven Bráhmans on that day. On
the twelfth day sixteen Bráhmans are fed, and on the thirteenth, five
Bráhmans are given a feast, after performing the Shráddha rites. On the
fourteenth day, again, a feast is given to about 100 to 500 Bráhmans
according to the means of the host. It is believed that, after the performance
of these rites, the soul of the deceased reaches heaven, and there is an end to
the troubles and misfortunes of the family.74
At Fonda in the Ratnágiri District dreams are said to indicate things that
have happened, or are about to happen in the near future. All white
substances other than cotton, salt, and bones, are considered auspicious, and
all black substances excepting a lotus, a horse, an elephant, and a deity are
considered inauspicious.3
At Ibrámpur in the Chiplun taluka, horrible dreams are good omens, while
pleasing dreams indicate approaching calamities.4
At Basani in the Ratnágiri District it is believed that the ancestors who take
interest in the welfare of their descendants appear in dreams and foretell
future events, so that the dreaming person may take the needful precautions
for the prevention of future calamities.6
The people of Poladpur in the Kolába District believe in dreams; and when
some of their deities appear in dreams and give them advice or directions,
they are careful to follow them. Sometimes even evil spirits appear in
dreams, and advise the people to do certain things to avert calamities.
People who have faith in such spirits act according to their wishes, and if
they fail to do so, trouble is sure to follow.9
The people of Khopoli in the Kolába District believe that if a person sees in
a dream, the dead body of a near relative, it indicates that the person whose
corpse was seen in the dream will live long.10
At Murbád in the Thána District it is believed that all black things, and
white things such as ashes, are inauspicious when seen in dreams, but a
black cow, white flowers, and pearls are auspicious. Considering the four
parts of the night, the dreams that occur in the first part prove effective
within one year, that of the second part within six months, that of the third
within three months, and of the fourth within one month, and those caused
at daybreak are realized immediately.14
At Adivare it is believed that only Hindu saints and ascetics, after deep and
devout meditation, are capable of removing the soul from the body. It is
believed that their souls go to heaven during that period and return at
pleasure. At present there are no such sádhus in the district.17
Many Hindus in the Ratnágiri District believe that the soul goes to drink
water at night, and therefore keep a pot filled with water at their sleeping
place.18
At Kolhápur, it is believed that the soul leaves the body temporarily at night
when a person is asleep.20
At Mithbáv in the Devgad taluka it is believed that the souls of those who
die with their wishes unfulfilled take the form of a Bhut. They enter the
bodies of people. Any woman who is attacked by the Bhut of a Pir becomes
able to speak in the Hindi language although it may not be her mother
tongue. When a child or a person is suffering from the attacks of a spirit,
incense is burnt, and it at once begins to tell the whereabouts of the spirit
and the reason why the person has been attacked. He is then asked to state
what he wants, and when the things which the spirit wants are offered, it
goes away.23 Spirits are generally invisible.
The spirits that belong to the class of malignant Bhuts are of a ferocious
appearance; but those that belong to the class of friendly Bhuts possess
bodies like human beings.24
The people of Chauk in the Kolába District believe that the main function
of a Bhut is to frighten people, to beat them, and to make them perform
unpleasant tasks and thereby to obtain food from them.30 At Poládpur it is
believed that if a person is able to bring a Bhut under his control he can
make it do every kind of work for himself.31 The people of Akshi believe
that kindling fire without any reason and throwing stones at certain houses
are the main functions of Bhuts.32 At Vávashi in the Pen taluka, it is
believed that Bhuts, while walking, never touch the earth but always move
through the air, and that they have no shadow.33 The old men of Shirgaum
in the Máhim taluka advise young children not to respond to the call of
anybody at night unless the person calling is an acquaintance. For such calls
are sometimes those of an evil spirit.34
At Kolhápur it is believed that the soul of a person after death attains that
state to which he aspires at the last moment before his death. Virtuous
persons who die without any desire reach heaven and remain there in the
form of the stars, where they are believed to enjoy the happiness of heaven.
Some of them are sent to this world when they wish to return. Sinners are
said to reach hell in consequence of their misdeeds, but some remain in this
world in the form of Bhuts.39
The people of Achare in the Málwan taluka believe that the souls of persons
who die by accident return to the same caste, and have to remain there till
the expiry of an appointed period.40
The people of Chauk believe that persons dying a sudden or violent death
leave wishes unfulfilled, and are therefore compelled to remain in this
world in the form of Bhuts.41
At Rái in the Sálsette taluka it is believed that the souls of those dying a
sudden or violent death attain salvation according to their deeds in lifetime,
but it is a current belief that those committing suicide take the form of a
ghost, and those who die on battlefields attain eternal salvation.42
At Kolhápur, it is believed that the souls of those who die violent deaths do
not attain salvation, but are turned into ghosts.43
The people of Ubhádánda in the Vengurla taluka believe that Bhuts do not
possess visible human forms. They can assume any shapes they like, but
there is a common belief that the hands and feet of Bhuts are always turned
backwards.44
The most favourable times for spirits to enter human bodies are midday,
midnight and twilight.45 Women in delivery as well as those in their menses
are most liable to be attacked by spirits.46 It is generally believed that
persons adorned with ornaments are attacked by spirits, especially in cases
of women and children. Again, a common belief prevails in the Konkan that
persons, and particularly ladies, decked with flowers and ornaments are
more liable to be attacked by spirits than others.47 The people of Fonda are
of opinion that spirits generally enter and leave human bodies through the
organ of hearing, while the people of Náringre hold that the hair is the best
way for spirits to enter.48 The residents of Ibrámpur state that the mouth and
the nose are the favourite channels for spirits entering human bodies.49 At
Mithbáv it is believed that spirits attack people in the throat, and generally
only those persons who are uncleanly in their habits are liable to be
attacked. There are no special ways for entering human bodies.50 At Chaul
a belief prevails that spirits enter the body when a person is suffering from
any disease or when he is frightened.51
If a man sneezes with his face towards the west, it is considered auspicious.
If a man sneezes while contemplating any task or business, the sneezing is
considered inauspicious. Sneezing at the time of taking food i.e. while at
meals, while sleeping, and while sitting on a praying carpet is considered
auspicious. Sneezing with one’s face turned towards the north, the south,
and the east is also unlucky.55
In the case of Bhagats and exorcists yawning is considered to indicate that
the disease will disappear.56
In the Konkan it is believed that sneezing and yawning indicate the call of
death, and therefore it is customary among the Hindus to snap the thumb
and the middle finger at the time of yawning, and to repeat the words
Shatanjiva i.e. Live for hundred years, at the time of sneezing.57 Sneezing
on a threshold is believed to forebode evil.58
At Kolhápur, people believe that sneezing and yawning forebode evil, and
the practice is to repeat the following words at the time of sneezing and
yawning, viz, Shatanjiva i.e. Live a hundred years, and also to repeat the
name of Rám, while snapping the thumb and finger (chutaki). In the case of
a person suffering from a serious illness, sneezing is supposed to indicate a
cure. If a woman sneezes while a man speaks, it is lucky, and if a man
sneezes it is unlucky. The reverse is the case in respect of females.59
(1) Vetál, (2) Brahmagraha, (3) Sambandhas, (4) Devachár, (5) Munja, (6)
Khavis, (7) Girha, (8) Chetak, (9) Zoting, (10) Vir, (11) Cheda, (12)
Mhasoba, (13) Jákhin or Alwant, (14) Lávsant, and (15) Hadal.
(2) Brahmagraha is the ghost of a Bráhman well versed in the Vedas, but
who is over proud of his education.67
(3) Sambandha is the spirit of a person who dies without an heir, and whose
funeral rites have not been performed by any member of his family. It
troubles the members of the family, but when invoked through a Bhagat it
becomes harmless, and even favourable to the family.68 It is the spirit of a
covetous person or a sanyási who dies with his desires unfulfilled.69 It does
not allow anybody to enjoy his wealth, and takes revenge on an enemy till
death ensues. It haunts trees, wells and unoccupied houses.70
(4) Devachár is the spirit of a Shudra who dies after his marriage.71 These
(Devachár) spirits are said to reside on the four sides of a village. The
spirits which reside in burial or cremation grounds, on river banks, and in
old trees are said to be subordinate to these. Cocoanuts, plantains, sugar,
cocks and goats must be given annually to gain their favour.72
(5) Munja is the spirit of a Bráhman boy who dies immediately after his
thread ceremony, but before the final ceremony called Sod-munj is
complete. It does not greatly affect its victim but simply frightens. When it
attacks, it is difficult to drive out. It is cast out only when the patient makes
a pilgrimage to a holy shrine.73 It resides in a Pipal tree or in a well.
(8) Chetak is the ghost of a person of the Kunbi or Shudra caste.79 This
spirit is also known as Dáv.
(9) Zoting is the ghost of a man belonging to the Khárvi or Koli caste.80 It
is also said to be the ghost of a Musalmán.81
(12) Mhasoba is the lord of the ghosts, and is equal in might to Vetál.85
(13) Jákhin or Alwant. Jákhin is the ghost of a woman who has a husband
alive. Alwant is believed to be the spirit of a woman dying at childbirth or
during her menses. It resides at burial or cremation grounds. Persons
attacked by this spirit are taken to Narsoba’s Wádi or Gángápur, which are
celebrated as shrines for the removal of malignant spirits.86
(15) Hadal or Hedali is the ghost of a woman who dies within ten days of
childbirth or during her menses. It is supposed to be an evil spirit, but it can
be kept in check by the use of a cane. It attacks all sorts of persons, but
leaves them as soon as it is beaten.88
This spirit is also known as Dákan in the Kolhápur district.89 Satavi is the
ghost of a woman. It troubles women in childbirth, and kills their children
on the 5th or 6th day after their birth.90 Shákini is the ghost of an unmarried
girl. Talkhámba is the ghost of an unmarried Shudra or a person from the
low castes.91 The people of Vijayadurg believe that one who hates and
troubles the Bráhmans and speaks ill of their religious duties becomes a
Brahma Sambandha after death.92 At Poládpur in the Kolába District the
ghost Bápa is represented by a stone painted with red lead and oil and
placed at the boundary of a field. It is the guardian of the field, and protects
the owners’ interests. Offerings are made to it annually. If the annual
offerings are neglected, it troubles the owner of the field. It also troubles
others when disturbed.93
The spirits known as Kálkáiche Bhut and Bahirobáche Bhut are not
troublesome. When they favour any person, he enjoys health and happiness
for a period of twelve years. But after that period he is ruined.94 In addition
to the varieties of malignant spirits already described, the following spirits
are known at Shirgaon in the Máhim taluka of the Thána District. They are
—Hirwa, Wághoba, Asarás, Gángud, Saitán and Chaitannadya. The spirit
known as Hirwa requires the offerings of a bow and an arrow, bháng, bájri
bread, and a chatni of garlic. The Wághoba haunts jungles and troubles
domestic animals. Cocoanuts and lamps of ghi are offered to it. Asarás are
the deities that dwell in water. They infest the wells and ponds, and attack
women and children at noon time and in the evening. Red lead, cocoanuts,
flowers, parched rice (láhya) and nádápudi are given to them.95
At Ibrámpur in the Ratnágiri District it is said that the evil spirit Zoting
goes about headless.96
The people of Medhe in the Rohe taluka believe that the spirit known as
Girha, which resides in water, goes about headless.97
At Shirgaon in the Máhim taluka it is believed that the spirit Hirwa goes
about headless. It troubles human beings and animals. The sea and the
jungle are its places of abode. To avoid being troubled by it, bháng,
cocoanuts, fowls are given to it.98
The people of Dahigaon in the Murbád taluka believe that the Bhut known
as Peesa goes about headless.99
Some evil spirits haunt trees such as the Pipal, Bábhul and Adulsa. Some
have their haunts on a public road where three streets meet, or in a dirty
place, some haunt old houses, and the rest prefer to reside in burial and
burning grounds.100
Many spirits dwell in burial or cremation grounds. Among them are Vetál,
Jákhin, Khavis, Kháprya, Zoting, Dáv, Girha, Alavat and Lávsat.101
The spirits Munja and Sambandh are said to reside near houses and old
trees that produce sweet smelling flowers. The spirits Devchár and Chálegat
are said to reside at the four corners or the boundary of a village.102
It is believed that all kinds of spirits assemble at night at the funeral ground
when a body is burnt or buried.103
The evil spirits known as Khavis, Zoting and Kafri are said to dwell on
mountains and in jungles; while the others named Sambandha, Jákhin,
Hadal and Lávsat are said to reside on trees.104
Munja resides in the Pipal tree. Sambandha dwells in the Banyan, Pipal
and Umbar trees. It is supposed to be a guardian of buried treasure.105
At Khopoli in the Kolába District it is believed that a young mother and her
child are generally attacked by the spirit of the dead wife of her husband, or
by a Hadal or Lávsat. The spirit that attacks a woman during her childbirth
is difficult to drive out. The spirits are always afraid of cleanliness, and
therefore, where there is cleanliness, there is very little fear of their
attacks.109
The people of Shirgaon believe that the fiend known as Hedli attacks a
young mother and her child. The Bhutya, or the sorcerer, makes use of his
cane and of the dirty incense known as Nurkya Uda, and compels her to
speak and to ask for what she wants. Sometimes she speaks and asks for the
things required. Boiled rice and curds, and oil with red lead are given to her.
When she leaves the body, the person becomes insensible for a short
time.110
The fiend known as Hadal, and other evil spirits of the female sex,
generally attack a young mother and her child. They are generally attacked
by these fiends on a public cross road where three roads meet, or under a
Bábhul tree, and also at wells.111
At Ubhádánda in the Vengurla taluka it is believed that those who are killed
by tigers or other wild beasts are born as kings in the next generation.112 On
the other hand the people of Bankavli are of opinion that those who suffer
death at the hands of tigers and other wild beasts are turned into spirits. The
spirit of a person killed by a tiger is called Vághvir.113
At Pendur it is believed that persons killed by tigers and other wild beasts
become Brahma Rákshasa. The same form is assumed by those who die by
accident. A murdered man becomes a Devachár.116
In the District of Kolhápur a belief prevails that the spirits of those killed by
tigers or other wild beasts assume the form of ghosts. It is also believed that
persons who die before they are married do not attain salvation, and
therefore it is considered inauspicious among the Hindus to remain
unmarried. This is the real reason why the majority of the Hindus marry
their children at an early age.117
The ghost of a woman dying in childbirth or during her menses assumes the
form of Alwant. For the purpose of preventing the dead woman turning into
a ghost the following device is adopted. The corpse, instead of being burnt
as usual, is buried underground, and four iron nails are fixed at the four
corners of the spot on which the body is buried, and plants bearing red
flowers are planted thereon.118
The special precautions that a father has to take at the birth of a child are:—
A knife or some other sharp weapon is kept under the bed of the woman in
order that the mother and her child may not be attacked by a spirit.120
The chief reason for ensuring the correct moment for the birth is that, if the
birth takes place at an unlucky hour, special rites are necessary for averting
the evil effects. These rites consist in the recitation of certain holy mantras
and in giving presents of money, sessamum, jágri, clarified butter, etc., to
the Bráhmans and alms to the poor.121
At Medhe in the Rohe taluka, it is customary for the father to throw a stone
in a well, a pond, or a river at the birth of his son, and then to look at the
face of the child.122
An owl is considered to be a bird of such evil repute that, in all parts of the
Konkan, it is considered necessary to perform expiatory rites when an owl
perches on the roof. If these rites are not performed, it is firmly believed
that some evil will befall the members of the family. Various omens are
drawn from the cries of the bird Pingla, and these cries are known as Kilbil,
Chilbil and Khit Khit.123
At Chauk an owl is said to have some connection with spirits. Its sound at
night indicates the approaching death of a sick person in the house. One
variety of the owl called the pingla is supposed to foretell future events by
its movements and cries, while the bat is considered an inauspicious bird,
and its appearance forebodes coming evil.126
The people of Kolhápur do not believe that there is any connection between
the bat or owl and the spirits of the dead, but they believe that, if an owl
cries out in the evening or at night, it indicates the death of a sick person in
the family. This applies also to the sound of a single pingla, but the sound
of a pair of pinglas is considered auspicious.128
The evil spirits which haunt ruins and guard buried treasures and old forts
are known as Mahápurush, Khavis, Brahma Rákshasa and Sambandh.130
If there be any buried treasure in an old unoccupied house, the owner of the
treasure remains there in the form of a ghost. If the treasure be near the
temple of a deity, it is supposed to be under the guardianship of that
deity.131
At Vijayadurg it is believed that a person who builds a house in the days of
his prosperity and does not survive to enjoy it, becomes a Sambandh. He
remains in that house in the form of a ghost, and troubles every one who
comes to stay there, excepting the members of his family. A man who buries
his treasure underground becomes a ghost after death, comes back to watch
his treasure, and troubles those who try to remove it.132
In the Kolhápur District there is a village Nigve beyond the river Panch
Ganga at a distance of three miles from Kolhápur, where the soul of a
person named Appáji Kulkarni has assumed the form of a Sambandh and
guards the buried treasures in his house. When anybody tries to dig up the
buried money, the ghost enters the body of his daughter-in-law and begins
to dance and cry out loudly, and does not allow any one to touch his
treasure. It is also said that he strikes the ground with his stick at night.
Another similar instance is cited in the case of the village of Latvade in the
Shirol Peta, where Bápujipant Kulkarni continues to guard his house after
death. He does not allow anybody to live in the house, and if any one is
bold enough to sleep there at night, the spirit of Bápuji appears and throws
him out of the house. The house is therefore uninhabited at present. His
wife has adopted a son, but he has to live in another village, Vadange.134
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.
textbookfull.com