If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > what is the significance of typeset in ksh files

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-17-10, 00:14
MIKELALA MIKELALA is offline
Registered User
 
Join Date: Nov 2009
Posts: 44
what is the significance of typeset in ksh files

I am working with an existing file .

In that file typeset variablename1='' is defined

and also

<variablename2>=''

whats the difference between these two declarations ?


Appreciate your help in this regard.

thanks/Mike
Reply With Quote
  #2 (permalink)  
Old 01-18-10, 10:55
kitaman kitaman is offline
Registered User
 
Join Date: Sep 2009
Location: Ontario
Posts: 528
All of the following extracted from the man page for ksh.

Quote:
A parameter is an identifier, one or more digits, or any of the
characters * , @, #, ?, -, $, and !. A named parameter (a
parameter denoted by an identifier) has a value and zero or more
attributes. Named parameters can be assigned values and
attributes by using the typeset special command. The attributes
supported by the shell are described later with the typeset
special command. Exported parameters pass values and attributes

An internal integer representation of a named parameter can be
specified with the -i option of the typeset special command.
Arithmetic evaluation is performed on the value of each
assignment to a named parameter with the -i attribute. If an
arithmetic base is not specified, the first assignment to the
parameter determines the arithmetic base. This base is used when
parameter substitution occurs.

caller. Ordinarily, variables are shared between the calling
program and the function. However, the typeset special command
used within a function defines local variables whose scope
includes the current function and all functions it calls.

The special command return is used to return from function calls.
Errors within functions return control to the caller.

Function identifiers can be listed with the -f or +f option of
the typeset special command. The text of functions are also
listed with -f. Functions can be undefined with the -f option of
the unset special command.

Ordinarily, functions are unset when the shell executes a shell
script. The -xf option of the typeset command allows a function to be global (exported)
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On