100 SHELL PROGRAMS
IN UNIX
Sarika Jain
Shivani Jain
FIREWAL MEDIA
(An Imprint of Laxmi Publications Pvt. Ltd.)
BANGALORE • CHENNAI • COCHIN • GUWAHATI • HYDERABAD
JALANDHAR • KOLKATA • LUCKNOW • MUMBAI • RANCHI
NEW DELHI
FIREWAL MEDIA
(
113, Golden House, Daryaganj,
New Delhi-110002
www.laxmipublications.com
: 2009
OFFICES
Bangalore
080-26 61 15 61
Chennai
044-24 34 47 26
Cochin
0484-239 70 04
Guwahati
0361-254 36 69, 251 38 81
Hyderabad
040-24 65 23 33
Jalandhar
0181-222 12 72
Kolkata
033-22 27 43 84
Lucknow
0522-220 95 78
Mumbai
022-24 91 54 15, 24 92 78 69
Ranchi
0651-221 47 64
FSH-3030-100-100 SHELL PROG IN UNIX
C—17102/09/02
: Kalyani Computer Services, New Delhi.
: Mehra Offset Press, Delhi.
CONTENTS
1. Introduction
I. An Overview
II. Salient Features of Unix
III. Hardware Requirements for Unix
IV. Getting Started
V. Unix Architecture
VI. Unix Basic Commands
VII. Portability with C
2. Programs
PREFACE
The UNIX system is so successful. Why?
The book’s small size is meant to keep your investment in time down to a minimum but with the greatest possible amount of knowledge. This book is organized as follows: Part I is an introduction to the most basic use of the system. It covers logging in, the file system, commonly used commands, and logging out. Part II contains 100 programs (including shell script and programs in C).
The best way to learn something is by doing it. Kindly practice the programs and verify or contradict what we say. All the examples in this text are actual, runnable code tested on UNIX system.
As a reader of this book, you are the most important critic and commentator. You can email or write to us directly to let us know what you did or didn’t like about this book – as well as what we can do to make our book stronger.
—AUTHORS
ACKNOWLEDGEMENT
We are grateful to many people for constructive comments and criticisms, and for their help in improving our code. The work of an author is only as good as the support from their family members and friends. Sarika Jain would like to specially thank her husband, Anuj Jain for letting her off all her household chores while working in the tree house on this project. Likewise, Shivani Jain wants to thank her all family members for their understanding and encouragement throughout this project. We cound not have done this without all of you.
—AUTHORS
PART I
INTRODUCTION
I. AN OVERVIEW