Bash declare/typeset: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
=External=
* https://www.gnu.org/software/bash/manual/html_node/Bash-Builtins.html
=Internal=
=Internal=



Revision as of 22:20, 23 July 2020

External

Internal

Overview

declare and typeset are equivalent.

Options

-p

Without an argument, the command will display the attributes and values of each variable name.

-F

Returns the name of the functions declared in the current context. Returns output similar to:

declare -f backup
declare -f comma_separated_list_to_space_separated
declare -f debug
declare -f debug_args
declare -f debug_args_no_nl
declare -f get_user_name
...

Also see:

Function Info

-f

Returns a functions' body.

typeset -f
declare -f

Also see:

Function Info