This shell script and shell programming site aims to provide book reviews and free ebook on bash shell, korn shell, shell commands, linux shell, awk shell, unix commands, ftp shell and all other shells.

Linux Kernel Development Second Edition

The Linux kernel is one of the most interesting yet least understood open-source projects. It is also a basis for developing new kernel code. That is why Sams is excited to bring you the latest Linux kernel development information from a Novell insider in the second edition of Linux Kernel Development. This authoritative, practical guide will help you better understand the Linux kernel through updated coverage of all the major subsystems, new features associated with Linux 2.6 kernel and insider information on not-yet-released developments. You'll be able to take an in-depth look at Linux kernel from both a theoretical and an applied perspective as you cover a wide range of topics, including algorithms, system call interface, paging strategies and kernel synchronization. Get the top information right from the source in Linux Kernel Development.

Developing code in the kernel does not require genius, magic, or a bushy Unix-hacker beard. The kernel, although having some interesting rules of its own, is not much different from any other large software endeavor. There is much to learnas with any big projectbut there is not too much about the kernel that is more sacred or confusing than anything else.

It is imperative that you utilize the source. The open availability of the source code for the Linux system is a rarity that we must not take for granted. It is not sufficient only to read the source, however. You need to dig in and change some code. Find a bug and fix it. Improve the drivers for your hardware. Find an itch and scratch it! Only when you write code will it all come together.

This book is based on the 2.6 Linux kernel series. Specifically, it is up to date as of Linux kernel version 2.6.10. The kernel is a moving target and no book can hope to capture a dynamic beast in a timeless manner. Nonetheless, the basics and core internals of the kernel are mature and I work hard to present the material with an eye to the future and with as wide applicability as possible.

Linux Kernel Development (2nd Edition) (Novell Press)

Linux Shell Scripting Tutorial

by Vivek G Gite

This tutorial is designed for beginners only and This tutorial explains the basics of shell programming by showing some examples of shell programs. Its not help or manual for the shell. While reading this tutorial you can find manual quite useful ( type man bash at $ prompt to see manual pages). Manual contains all necessary information you need, but it won't have that much examples, which makes idea more clear. For that reason, this tutorial contains examples rather than all the features of shell. I assumes you have at least working knowledge of Linux i.e. basic commands like how to create, copy, remove files/directories etc or how to use editor like vi or mcedit and login to your system. Before Starting Linux Shell Script Programming you must know
  • Kernel
  • Shell
  • Process
  • Redirectors, Pipes, Filters etc.

What's Kernel
Kernel is hart of Linux O/S. It manages resource of Linux O/S. Resources means facilities available in Linux. For eg. Facility to store data, print data on printer, memory, file management etc . Kernel decides who will use this resource, for how long and when. It runs your programs (or set up to execute binary files) It's Memory resident portion of Linux. It performance following task :-

  • I/O management
  • Process management
  • Device management
  • File management
  • Memory management

What's Linux Shell
Computer understand the language of 0's and 1's called binary language, In early days of computing, instruction are provided using binary language, which is difficult for all of us, to read and write. So in O/s there is special program called Shell. Shell accepts your instruction or commands in English and translate it into computers native binary language.

Click to Download

Advanced Bash-Scripting Guide

By Mendel Cooper
The shell is a command interpreter. More than just the insulating layer between the operating system kernel and the user, it's also a fairly powerful programming language. A shell program, called a script, is an easy-to-use tool for building applications by "gluing" together system calls, tools, utilities, and compiled binaries. Virtually the entire repertoire of UNIX commands, utilities, and tools is available for invocation by a shell script. If that were not enough, internal shell commands, such as testing and loop constructs, give additional power and flexibility to scripts. Shell scripts lend themselves exceptionally well to administrative system tasks and other routine repetitive jobs not requiring the bells and whistles of a full-blown tightly structured programming language.
A working knowledge of shell scripting is essential to anyone wishing to become reasonably proficient at system administration, even if they do not anticipate ever having to actually write a script. Consider that as a Linux machine boots up, it executes the shell scripts in /etc/rc.d to restore the system configuration and set up services. A detailed understanding of these startup scripts is important for analyzing the behavior of a system, and possibly modifying it.
Writing shell scripts is not hard to learn, since the scripts can be built in bite-sized sections and there is only a fairly small set of shell-specific operators and options to learn. The syntax is simple and straightforward, similar to that of invoking and chaining together utilities at the command line, and there are only a few "rules" to learn. Most short scripts work right the first time, and debugging even the longer ones is straightforward.
A shell script is a "quick and dirty" method of prototyping a complex application. Getting even a limited subset of the functionality to work in a shell script is often a useful first stage in project development. This way, the structure of the application can be tested and played with, and the major pitfalls found before proceeding to the final coding in C, C++, Java, or Perl.
Shell scripting hearkens back to the classic UNIX philosophy of breaking complex projects into simpler subtasks, of chaining together components and utilities. Many consider this a better, or at least more esthetically pleasing approach to problem solving than using one of the new generation of high powered all-in-one languages, such as Perl, which attempt to be all things to all people, but at the cost of forcing you to alter your thinking processes to fit the tool.

Linux Programming

By Kurt Wall, Mark Watson, and Mark Whitis
Linux has always provided a rich programming environment, and it has only grown richer. Two new compilers, egcs and pgcs, joined the GNU project’s gcc, the original Linux compiler. In fact, as this book went to press, the Free Software Foundation, custodians of the GNU project, announced that gcc would be maintained by the creators and maintainers of egcs. A huge variety of editors stand alongside the spartan and much-maligned vi and emacs’ marvelous complexity. Driven largely by the Linux kernel, GNU’s C library has evolved so dramatically that a new version, glibc (also known as libc6) has emerged as the standard C library. Linux hackers have honed the GNU project’s always serviceable development suite into powerful tools. New widget sets have taken their place beside the old UNIX standbys. Lesstif is a free, source-compatible implementation of Motif 1.2; KDE, the K Desktop Environment based on the Qt class libraries from TrollTech, answers the desktop challenge posed by the X Consortium’s CDE (Common Desktop Environment).
What This Book Will Do for You
In this book, we propose to show you how to program in, on, and for Linux. We’ll focus almost exclusively on the C language because C is still Linux’s lingua franca. After introducing you to some essential development tools, we dive right in to system programming, followed by a section on interprocess communication and network programming.
After a section devoted to programming Linux’s user interface with both text-based and graphical tools (the X Window system), a section on specialized topics, including shell programming, security considerations, and using the GNU project’s gdb debugger, rounds out the technical discussion. We close the book with three chapters on a topic normally disregarded in programming books: delivering your application to users. These final chapters show you how to use package management tools such as RPM, how to create useful documentation, and discuss licensing issues and options. If we’ve done our job correctly, you should be well prepared to participate in the great sociological and technological phenomenon called “Linux.”
Linux Programming Unleashed (2nd Edition)

UNIX Bourne Shell Programming

This course is for individuals who have completed "UNIX forBeginning Users" (or equivalent experience) and want to write UNIX BourneShell script files. A script file contains a sequence of UNIX commands which can be executed by entering one command. Itis assumed that the student already has a good understanding of the UNIX operating system, be able to use a UNIX editor, and be familiar with a computer terminal or typewriter keyboard.
Upon successful completion of this course the student will be able to:
  • Write moderately complex BourneShell scripts.
  • Make a BourneShell script executable.
  • Demonstrate how to use the following BourneShell commands: shift, exit, expr, test, if then, if then else, if then elif, for, while, until, and case.
  • Use the following BourneShell constructs: tracing mechanisms (for debugging), user variables, BourneShell variables, read-only variables, positional parameters, reading input to a BourneShell script, command substitution, comments, and exporting variables. In addition, test on numeric values, test on file type, and test on character strings are covered.
  • Create a ".profile" script to customize the user environment.
  • Use advanced features of File Transfer Protocol (FTP)
  • Compile source code into object and executable modules.
  • Optional: KornShell programming. This is of primary interest to programmers.
  • Convert VMS DCL command files to UNIX Shell.

Click to Read More/Download

UNIX System Calls and Subroutines using C

By A. D. Marshall
In order to use Solaris and most other Unix Systems you will need to be familiar with the Common Desktop Environment (CDE). Before embarking on learning C with briefly introduce the main features of the CDE.
Most major Unix vendors now provide the CDE as standard. Consequently, most users of the X Window system will now be exposed to the CDE. Indeed, continuing trends in the development of Motif and CDE will probably lead to a convergence of these technologies in the near future. This section highlights the key features of the CDE from a Users perspective.
Upon login, the user is presented with the CDE Desktop. The desktop includes a front panel, multiple virtual workspaces, and window management. CDE supports the running of applications from a file manager, from an application manager and from the front panel. Each of the subcomponents of the desktop are described below.

Unix Programming Tools

By Parlante, Zelenski, and many others
This document explains the overall edit-compile-link-debug programming cycle and introduces several common Unix programming tools— gcc, make, gdb, emacs, and the Unix shell. The goal is to describe the major features and typcial uses of the tools and show how they fit together with enough detail for simple projects.
This is document #107, Unix Programming Tools, in the CS Education Library at Stanford. This and other free educational materials are available at http://cslibrary.stanford.edu/. This document is free to be used, reproduced, or redistributed so long as this notice is clearly reproduced at its beginning.

Contents

  • Introduction — the compile-link process
  • The gcc compiler/linker
  • The make project utility
  • The gdb debugger
  • The emacs editor
  • Summary of Unix shell commands

Click to Download

The Linux Kernel Module Programming Guide

By Peter Jay Salzman and Ori Pomerantz
Ori's original document was good about supporting earlier versions of Linux, going all the way back to the 2.0 days. I had originally intended to keep with the program, but after thinking about it, opted out. My main reason to keep with the compatibility was for Linux distributions like LEAF, which tended to use older kernels. However, even LEAF uses 2.2 and 2.4 kernels these days.
Both Ori and I use the x86 platform. For the most part, the source code and discussions should apply to other architectures, but I can't promise anything. One exception is Chapter 12, Interrupt Handlers, which should not work on any architecture except for x86.
What Is A Kernel Module?
So, you want to write a kernel module. You know C, you've written a few normal programs to run as processes, and now you want to get to where the real action is, to where a single wild pointer can wipe out your file system and a core dump means a reboot.
What exactly is a kernel module? Modules are pieces of code that can be loaded and unloaded into the kernel upon demand. They extend the functionality of the kernel without the need to reboot the system. For example, one type of module is the device driver, which allows the kernel to access hardware connected to the system. Without modules, we would have to build monolithic kernels and add new functionality directly into the kernel image. Besides having larger kernels, this has the disadvantage of requiring us to rebuild and reboot the kernel every time we want new functionality.

Followers