Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2009

    Unanswered: 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


    whats the difference between these two declarations ?

    Appreciate your help in this regard.


  2. #2
    Join Date
    Sep 2009
    Provided Answers: 1
    All of the following extracted from the man page for ksh.

    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)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts