Variables

   

Korn Shell: Unix and Linux Programming Manual, Third Edition, The
By Anatole Olczak

Table of Contents
Appendix G.  Pdksh Quick Reference


Like in other high-level progamming languages, variables are used by the Korn shell to store values. Variable names can begin with an alphabetic or underscore character, followed by one or more alphanumeric or underscore characters. Other variable names that contain only digits or special characters are reserved for special variables (called parameters) set directly by the Korn shell. Data types (called attributes) and one-dimensional arrays are also supported by the Korn shell.

Variable/Attribute Assignment Format

variable=

declare variable and set it to null

typeset variable=

declare variable and set it to null. If used within a function, then a local variable is declared.

variable=value

assign value to variable

typeset variable=value

assign value to variable. If used within a function, then a local variable is declared.

typeset ?/span>attribute variable=value

assign attribute and value to variable

typeset ?/span>attribute variable

assign attribute to variable

typeset +attribute variable

remove attribute from variable (except readonly)

Variable/Attribute Listing Format

typeset ?/span>attribute

display a list of variable names and their values that have attribute set

typeset +attribute

display a list of variable names that have attribute set


       
    Top
     



    Korn Shell. Unix and Linux Programming Manual, Third Edition
    Korn Shell. Unix and Linux Programming Manual, Third Edition
    ISBN: N/A
    EAN: N/A
    Year: 2000
    Pages: 177

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net