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.
Showing posts with label shell. Show all posts
Showing posts with label shell. Show all posts

Learning the Shell

By William Shotts, Jr.
What is "the shell"?
Simply put, the shell is a program that takes your commands from the keyboard and gives them to the operating system to perform. In the old days, it was the only user interface available on a Unix computer. Nowadays, we have graphical user interfaces (GUIs) in addition to command line interfaces (CLIs) such as the shell.
On most Linux systems a program called bash (which stands for Bourne Again SHell, an enhanced version of the original Bourne shell program, sh, written by Steve Bourne) acts as the shell program. There are several additional shell programs available on a typical Linux system. These include: ksh, tcsh and zsh.
What's an xterm, gnome-terminal, konsole, etc.?
These are called "terminal emulators." They are programs that put a window up and let you interact with the shell. There are a bunch of different terminal emulators you can use. Most Linux distributions supply several, such as: xterm, rxvt, konsole, kvt, gnome-terminal, nxterm, and eterm.

THE Unix SHELL GUIDE

By Norman J. Buchanan and Douglas M. Gingrich
What is a shell?
A shell is a command interpreter. While this is certainly true it likely doesn't enlighten the reader any further. A shell is an entity that takes input from the user and deals with the computer rather than have the user deal directly with the computer. If the user had to deal directly with the computer he would not get much done as the computer only understands strings of 1's and 0's. While this is a bit of a misrepresentation of what the shell actually does (the idea of an operating system is neglected) it provides a rough idea that should cause the reader to be grateful that there is such a thing as a shell. A good way to view a shell is as follows. When a person drives a car, that person doesn't have to actually adjust every detail that goes along with making the engine run, or the electronic system controlling all of the engine timing and so on. All the user (or driver in this example) needs to know is that D means drive and that pressing accelerator pedal will make the car go faster or slower. The dashboard would also be considered part of the the shell since pertinent information relating to the user's involvement in operating the car is displayed there. In fact any part of the car that the user has control of during operation of the car would be considered part of the shell. I think the idea of what a shell is coming clear now. It is a program that allows the user to use the computer without him having to deal directly with it. It is in a sense a protective shell that prevents the user and computer from coming into contact with one another.
Basic Unix primer
While it assumed that the reader has a familiarity of Unix, a brief overview can only enhance previous knowledge. Unix comes in a variety of constantly changing flavors (SUNOS, HPUX, BSD and Solaris, just to name a few). Each of these Unix types will have small variations from all of the others. This may seem a bit discouraging at first, but in reality each version of Unix has more in common with all of the others than differences. The ls, for example, will give a listing of the current directory in any Unix environment. The changes or semantics local to any particular brand of Unix should be explained in the man pages that come with that particular system. The purpose of this book is not to explore the differences between differnt Unix flavors but rather to assume that they are all equivalent and look at how the different shells behave. Hence, the rest of the book assumes a kind of generic Unix operating system (except where explicitly stated otherwise).

Getting the Most From Your Shell

By Paul Dunne
Everyone uses it, but do they know how to use it to best advantage? I'm talking about the Unix shell. No matter whether you log in to a super-duper latest-thing X desktop or with a Wyse 30 over a slow modem connection, you will most likely at some point be using the shell. This article looks at how you can get the most from it.
  • Introduction
  • All Those Dot Files
  • Environment Variables
  • Aliases
  • Functions
  • Options
  • Start-up Commands
  • The Command Lne
  • Resources
  • Conclusion

Questions regarding this article should be directed to the author at paul.dunne@mailroom.com

While the rest of the world points and clicks in a scary little world of icons, all alike, we in the world of Unix get to use our good old CLI, or command line interface. One big reason why the CLI has remained so prevaisive in Unix environments is that it is actually damn good. Modern Unix shells are stable and powerful. This article looks at some methods to increase the power and usableness of your shell.

Introduction
So, I will be looking at how to get more out of your shell. I personally use a version of the Korn shell, pdksh, but most of what I say will be applicable to bash; where it isn't, I'll tell you so. As Zsh is mostly compatible with ksh, most of the article is useful for that as well. I will not bother with the C shell, on the grounds that I neither use it nor like it, and that it is so different as to be really the subjet of a seperate article. This article is not a shell tutorial for novices; it will presume that you know how to run commands, what wildcards are, and such stuff. What I will be doing is taking a look at some things that a lot of regular shell users don't realise can be done.

Click to Read More

An Introduction to the Unix Shell

Created by 'era' at iki.fi.
Mirrored by Steve Parker
steve-parker.org
The shell is a command programming language that provides an interface to the UNIX operating system. Its features include control-flow primitives, parameter passing, variables and string substitution. Constructs such as while, if then else, case and for are available. Two-way communication is possible between the shell and commands. String-valued parameters, typically file names or flags, may be passed to a command. A return code is set by commands that may be used to determine control-flow, and the standard output from a command may be used as shell input.
The shell can modify the environment in which commands run. Input and output can be redirected to files, and processes that communicate through `pipes' can be invoked. Commands are found by searching directories in the file system in a sequence that can be defined by the user. Commands can be read either from the terminal or from a file, which allows command procedures to be stored for later use.

UNIX shell differences and how to change your shell

FAQ
faqs.org
Why change your shell
The UNIX shell is most people's main access to the UNIX operating system and as such any improvement to it can result in considerably more effective use of the system, and may even allow you to do things you couldn't do before. The primary improvement most of the new generation shells give you is increased speed. They require fewer key strokes to get the same results due to their completion features, they give you more information (e.g. showing your directory in your prompt, showing which files it would complete) and they cover some of the more annoying features of UNIX, such as not going back up symbolic links to directories.
A brief history of UNIX shells
Note, this history is just known to be slightly out of historical order, it is in the process of being corrected, but for the moment should be taken with a pinch of salt In the near beginning there was the Bourne shell /bin/sh (written by S. R. Bourne). It had (and still does) a very strong powerful syntactical language built into it, with all the features that are commonly considered to produce structured programs; it has particularly strong provisions for controlling input and output and in its expression matching facilities. But no matter how strong its input language is, it had one major drawback; it made nearly no concessions to the interactive user (the only real concession being the use of shell functions and these were only added later) and so there was a gap for something better.

ZSH Documentation

Written by Paul Falstad
Co-ordinating by Peter Stephenson
zsh.sunsite.dk
Zsh is a UNIX command interpreter (shell) usable as an interactive login shell and as a shell script command processor. Of the standard shells, zsh most closely resembles ksh but includes many enhancements. Zsh has command line editing, builtin spelling correction, programmable command completion, shell functions (with autoloading), a history mechanism, and a host of other features.
Invocation Options The following flags are interpreted by the shell when invoked to determine where the shell will read commands from:
-c
Take the first argument as a command to execute, rather than reading commands from a script or standard input. If any further arguments are given, the first one is assigned to $0, rather than being used as a positional parameter.
-i
Force shell to be interactive.
-s
Force shell to read commands from the standard input. If the -s flag is not present and an argument is given, the first argument is taken to be the pathname of a script to execute.
After the first one or two arguments have been appropriated as described above, the remaining arguments are assigned to the positional parameters.
For further options, which are common to invocation and the set builtin.
Options may be specified by name using the -o option. -o acts like a single-letter option, but takes a following string as the option name. For example,
zsh -x -o shwordsplit scr
runs the script scr, setting the XTRACE option by the corresponding letter `-x' and the SH_WORD_SPLIT option by name. Options may be turned off by name by using +o instead of -o. -o can be stacked up with preceding single-letter options, so for example `-xo shwordsplit' or `-xoshwordsplit' is equivalent to `-x -o shwordsplit'.

The C Shell tutorial

University of Hawaii at Manoa
What is a shell?
A shell is a program which provides a user interface. With a shell, users can type in commands and run programs on a Unix system. Basically, the main function a shell performs is to read in from the terminal what one types, run the commands, and show the output of the commands.
What's so good about C Shell?
The C shell was written by Bill Joy at the University of California at Berkeley. His main intent for writing the C shell was to create a shell with C language-like syntax.
What can one do with C Shell?
The main use of the C shell is as an interactive shell, but one can write programs using the C shell. These programs are called shell scripts.

Followers