Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
3Activity
0 of .
Results for:
No results containing your search query
P. 1
Korn Shell by Marisa Luvisetto

Korn Shell by Marisa Luvisetto

Ratings: (0)|Views: 233 |Likes:
Published by azertyui30008561
Learning KSH with Marisa Luvisetto
Learning KSH with Marisa Luvisetto

More info:

Published by: azertyui30008561 on May 14, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

08/06/2013

pdf

text

original

 
Shell Programming
KornShell
Marisa Luvisetto
02/05/2001
 
1
Table of Contents
Introduction.............................................................................................................................................21.Korn shell variables..........................................................................................................................22.Korn shell background and foreground...........................................................................................73.Korn shell arithmetic.......................................................................................................................84.Korn shell options............................................................................................................................95.Kornshell scripts...........................................................................................................................116.Korn shell
exec, read 
and miscellaneous commands....................................................................20
 
2
Introduction
 Korn shell is a higher level shell. Korn shell is Bourne compatible with C shell features.The following notes are derived from The KornShell User and Programming Manual by Anatole Olczak published by Addison-Wesley. Korn shell will be denoted in the following  sections also either askshorKsh. Akshcommand is a sequence of words separated by spaces, the first word is the command name,the following ones are the command arguments. The command value is its exit statusthat is200 + signal (octal)in case of abnormal termination. The exist status of a pipeline isthe value of the last command. Kshenables tilde substitution as describedinCshell. Note that a tilde
 followed by+isreplaced by
$PWD 
and followed by-is replaced by
$OLDPWD 
 Inksh, as well as in any other shell, the system needs a set of global informations in the form of name-value lists. System required names oridentifiersare set at login and areknown globally via theexportmechanism.Exported identifiersform the working environmentof the shell. Example of required identifiers are
PATH
that defines thecommand search path and 
TERM 
that defines the terminal type for correct processing of characters such as special keys.Environmentidentifiers are usually divided into 2 different  groups depending on login level setting. The basic identifiers have usually uppercasenames and are inquired by theenvcommand. The usermay assign and reassign anyidentifiers using theexportortypeset-xcommands. When the value of an exported identifier is changed,kshexports it automatically. This feature is not supported by Bourne shell. Kshstores commands in a history file or buffer up to
HISTSIZE
commands. If the
HISTFILE
variable is not set, file
$HOME/.sh_history 
is used. The history file is manipulated by thefccommand. The editor is used according to variable
FCEDIT 
 , default/usr/bin/ed. Editing maybe handled byvioremacsdepending on user customization.For more informations onkshediting checkman ksh.
1.Korn shell variables
Variables are set with the=operator as in Bourne shell. No space is allowed around the=operator. Variables may have attributes assigned bytypesetwith the following syntax:
Korn Shell
typeset 
syntax
typeset -attrib(s) variable=[value]
assign attribute and optional value
typeset +attrib(s) variable
remove attribute
typeset 
list all varsand attributes
typeset -attrib
list all vars with
-attrib
type

Activity (3)

You've already reviewed this. Edit your review.
1 thousand reads
1 hundred reads

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->