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
2Activity
0 of .
Results for:
No results containing your search query
P. 1
kshrefltr

kshrefltr

Ratings: (0)|Views: 1,146|Likes:
Published by kuba
Korn Shell Reference Guide
Korn Shell Reference Guide

More info:

Published by: kuba on Dec 29, 2007
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

06/16/2009

pdf

text

original

 
Korn Shell Syntax - A Reference Guide
Korn Shell Syntax
A Reference Guideprovided by:Context-Switch Limited
Context-Switch Limited  Egham, Surrey, UK http://www.context-switch.com
 
Korn Shell Syntax - A Reference Guide
Korn Shell Syntax Reference
ThefollowingdetailsprovideareferenceofthesyntaxavailablewithintheKornshell.Notallsyntaxiscoveredinthesepages.PleaserefertothemanpagesfortheKornshellorequivalent(
 for example, the POSIX shell in the HP-UX ™ environment 
) for additional information.
Filename and Directory-name Substitution:
The Korn shell has a number of metacharacters and pattern-structures that can be used tosubstitutefilenamesanddirectorynamesonacommandline.Thesearequiteoftenreferredtoas
wildcard 
characters.The shell will substitute, on the command line, any file or directory name that matches the pattern supplied on the command line.
Table 1: Shell Meta Characters
Shell Meta CharacterDescription
?
Match any single character.
*
Match zero, 1 or more characters.
[...]
A character class. This can be used in the following ways:
[abc]
Match any single, specified, character.
[a-zA-Z0-9]
Matchanyoftherangesofcharacters(Alphabetic/Numeric).
 Note: ranges must be valid 
[!...]
 Negate - Do not match any character specified within thecharacter class.
?(pat1|...|patn)
Match zero or 1 of the specified patterns.
@(pat1|...|patn)
Match exactly 1 of the specified patterns.
*(pat1|...|patn)
Match exactly 1 of the specified patterns.
+(pat1|...|patn)
Match zero, 1 or more of the specified patterns.
!(pat1|...|patn)
Match any pattern except the patterns specified.
 
Korn Shell Syntax - A Reference Guide
String Variable Assignment:
In the Korn shell, string variables must be assigned values using the syntax:
variable_name=value
If a variable is to used as an ENVIRONMENT variable, is must be marked for export to sub- processes using the export command.
variable_name=value export variable_name
*
 NOTE:WhenvariablesareassignedLeftorRight-alignmentformatting,usingthe
typeset
command, the
typeset
display output characteristics will only be applied if the variable isquoted within double-quotes (“) on the shell command line.(See Variable Substitution)
Table 2: String Variable Assignment
SyntaxMeaning
var=value
Assign value as the contents of the variable var.
var="v1 v2 v3"
Assignthethreewords
v1v2v3
asthecontentsof the variable var.
var=$var2
Assign the contents of variable var2 to the variablevar.
var=$(cmd)
AssigntheoutputoftheUNIXcommand,cmd,asthecontents of the variable var.
var=`cmd`
Bourneshellequivalentoftheabovecommandoutputassignment (
 supported within the Korn shell 
).
var=
Assign NULL as the contents of the variable var.
var[n]=value
Assign value as the contents of the
n
th element of array variable var.
typeset -l var=Val
Assign the value, val, to the variable, var, and forcethecontentstobedisplayed/substitutedaslower-case(eg:
val
).
typeset -u var=Val
Assign the value, val, to the variable, var, and forcethecontentstobedisplayed/substitutedasupper-case(eg:
VAL
).
typeset -L20 var=val
Assign the value, val, to the variable, var, and setdisplay attributes to be left-aligned, truncated to 20characters.*
typeset -RZ20 var=val
Assign the value, val, to the variable, var, and setdisplay attributes to be right-aligned, truncated to 20characters.*

Activity (2)

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)//-->