-Programs are tools.
-And like all good tools, they should be specific in function, but usable for many different purposes.
-In order for programs to become general-purpose tools, they must be data-independent. This means three things:
1.Within limits, the output of any program should be usable as the input to another.
2.All of the information needed by a program should either be contained in the data stream passed to it or specified on the command line. A program should not prompt for input or do unnecessary formatting of output. In most cases, this means that UNIX programs work with plain text files that don't contain "non-printable" or "control" characters.
3.If no arguments are given, a program should read the standard input (usually the terminal keyboard) and write the standard output (usually the terminal screen).
-Programs that can be used in this way are often called filters.
-One of the most important consequences of these guidelines is that programs can be strung together in "pipelines" in which the output of one program is used as the input of another. A vertical bar (|) represents the pipe : it means "take the output of the program on the left and feed it into the program on the right."
-For example, you can pipe the output of a search program to another program that sorts the output, and then pipe the result to the printer program or redirect it to a file
Thursday, October 11, 2007
2. Unix - Behind the Curtain
-Probably the single most important concept for would-be power users to grasp is that you don't talk to UNIX directly
-Instead, you talk to a program called the shell
-The UNIX operating system proper is referred to as the kernel
-Usually, only programs talk to the kernel (through system calls)
How it Works ???
-Users talk to the shell, which interprets their commands and either executes them directly or passes them on to other programs. These programs in turn request lower-level services from the kernel.
-First of all, you can choose between several different shells , each of which may have different rules for interpreting command lines
-Second, the shell has to interpret the command line you type and package it up for the command you are calling. Because the shell reads the command line first, it's important to understand just how the shell changes what it reads.
-One basic rule is that the shell uses "white space" (spaces or tabs) to separate each "argument" of a command
-But sometimes, you want the shell to interpret its arguments differently.The shell lets you do this by quoting arguments
-Instead, you talk to a program called the shell
-The UNIX operating system proper is referred to as the kernel
-Usually, only programs talk to the kernel (through system calls)
How it Works ???
-Users talk to the shell, which interprets their commands and either executes them directly or passes them on to other programs. These programs in turn request lower-level services from the kernel.
-First of all, you can choose between several different shells , each of which may have different rules for interpreting command lines
-Second, the shell has to interpret the command line you type and package it up for the command you are calling. Because the shell reads the command line first, it's important to understand just how the shell changes what it reads.
-One basic rule is that the shell uses "white space" (spaces or tabs) to separate each "argument" of a command
-But sometimes, you want the shell to interpret its arguments differently.The shell lets you do this by quoting arguments
Wednesday, October 10, 2007
1. Unix - A teaser
-Ken Thompson and Dennis Ritchie first wrote UNIX at AT&T Bell Labs
-UNIX is unique in that it wasn't designed as a commercial operating system meant to run application programs, but as a hacker's toolset, by and for programmers. In fact, an early release of the operating system went by the name PWB (Programmer's Work Bench)
-UNIX is also important to power users because it's one of the last popular operating systems that doesn't force you to work behind an interface of menus and windows and a mouse with a "one-size(-doesn't)-fit-all" programming interface
-UNIX is unique in that it wasn't designed as a commercial operating system meant to run application programs, but as a hacker's toolset, by and for programmers. In fact, an early release of the operating system went by the name PWB (Programmer's Work Bench)
-UNIX is also important to power users because it's one of the last popular operating systems that doesn't force you to work behind an interface of menus and windows and a mouse with a "one-size(-doesn't)-fit-all" programming interface
Subscribe to:
Posts (Atom)