Chapter 11 The awk Programming Language. Man/man1/ksh.html man page. Ksh is a command and programming language that executes commands read from a terminal or a file. Rksh is a restricted version of the command interpreter ksh; it is used to set up login names and execution environments whose capabilities are more controlled than those of the standard shell. Rpfksh is a profile shell version of the command interpreter ksh; it is used to to execute commands with the attributes specified by the user's profiles (see See Invocation below for the meaning of arguments to the shell. Definitions A metacharacter is one of the following characters: ; & ( ) | < > new-line space tab A blank is a tab or a space. A command is a sequence of characters in the syntax of the shell language.
Commands A simple-command is a list of variable assignments (see Variable Assignments below) or a sequence of blank separated words which may be preceded by a list of variable assignments (see Environment below). A pipeline is a sequence of one or more commands separated by |. The AWK Manual - Table of Contents. KSH script BASICS. Contents Principle of ScriptVariablesBranchingLoopingCommandline ArgumentsComparisonsVariable ManipulationsKsh Regular ExpressionsFunctionsData RedirectionPipesCoprocessesRead Input from User and from FilesSpecial VariablesAction on Success or Failure of a CommandTrivial CalculationsNumerical Calculations using "bc""grep""sed""awk""perl" Principle of Script Defining the Shell Type To make a ksh script (which is a ksh program) crate a new file with a starting line like:#!
/usr/bin/ksh It is important that the path to the ksh is propper and that the line doesn not have more than 32 characters. Four Types of Lines A script has four types of lines: The shell defining line at the top, empty lines, commentary lines starting with a # and command lines. . #! Start and End of Script The script starts at the first line and ends either when it encounters an "exit" or the last line. Start and End of Command print -n "Name: "; read name; print "" Name and Permissions of Script File Variables Filling in Using ? Awk - A Tutorial and Introduction - by Bruce Barnett.
The examples given below have the extensions of the executing script as part of the filename. Why learn AWK? In the past I have covered grep and sed. AWK - the (very old) original from AT&T NAWK - A newer, improved version from AT&T GAWK - The Free Software foundation's version Basic Structure.