background preloader

KSH

Facebook Twitter

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. The shell from which you are starting the script will find this line and and hand the whole script over to to ksh. Without this line the script would be interpreted by the same typ of shell as the one, from which it was started. 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. . #! Variables Filling in. Awk - A Tutorial and Introduction - by Bruce Barnett. Your browser does not have Javascript enabled. I use Javascript for analytics, and to show ads which pay for the maintenance Last modified: Thu Apr 23 16:37:47 EDT 2015 Part of the Unix tutorials And then there's My blog Table of Contents Copyright 1994,1995 Bruce Barnett and General Electric Company Copyright 2001, 2004, 2013, 2014 Bruce Barnett All rights reserved You are allowed to print copies of this tutorial for your personal use, and link to this page, but you are not allowed to make electronic copies, or redistribute this tutorial in any form without permission.

Original version written in 1994 and published in the Sun Observer Awk is an extremely versatile programming language for working on files. 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.