declare

Basic Linux Command Example: 

 

Get help on Linux declare Command.

 

   Linux declare command is use to set variable values and attributes on Linux system.  The Linux declare command is one of bash shell built in command.  The command example below show how to get help on Linux declare command using shell command, this help show information on how to use the Linux declare command, the declare command options and the arguments that can be use with Linux declare command.

 

Get Linux declare command help

 

  Execute help command and the name of Linux command that we want the help file, the example below we execute help command with -m option to get the help for declare command using the manpage format.

declare linux command

[linux@fedora11 ~]$ help -m declare

NAME

    declare - Set variable values and attributes.

 

SYNOPSIS

    declare [-aAfFilrtux] [-p] [name[=value] ...]

 

DESCRIPTION

    Set variable values and attributes.

 

    Declare variables and give them attributes.  If no NAMEs are given,

    display the attributes and values of all variables.

 

    Options:

      -f        restrict action or display to function names and definitions

      -F        restrict display to function names only (plus line number and

        source file when debugging)

      -p        display the attributes and value of each NAME

 

    Options which set attributes:

      -a        to make NAMEs indexed arrays (if supported)

      -A        to make NAMEs associative arrays (if supported)

      -i        to make NAMEs have the `integer' attribute

      -l        to convert NAMEs to lower case on assignment

      -r        to make NAMEs readonly

      -t        to make NAMEs have the `trace' attribute

      -u        to convert NAMEs to upper case on assignment

      -x        to make NAMEs export

 

    Using `+' instead of `-' turns off the given attribute.

 

    Variables with the integer attribute have arithmetic evaluation (see

    the `let' command) performed when the variable is assigned a value.

 

    When used in a function, `declare' makes NAMEs local, as with the `local'

    command.

 

    Exit Status:

    Returns success unless an invalid option is supplied or an error occurs.

 

SEE ALSO

    bash(1)

 

IMPLEMENTATION

    GNU bash, version 4.0.16(1)-release (i386-redhat-linux-gnu)

    Copyright (C) 2009 Free Software Foundation, Inc.

    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

 

[linux@fedora11 ~]$

 

Keywords: declare, declare command, linux declare command, declare linux command, declare help, help declare, command declare help, help declare command