Differences between declare, typeset and local variable in Bash

后端 未结 3 1500
终归单人心
终归单人心 2021-01-31 14:22

When typing variables in Bash, what is the difference between declare and typeset? When used inside a function: what is the difference between de

3条回答
  •  伪装坚强ぢ
    2021-01-31 14:47

    In the Bash manual under section 4.2 Bash Builtin Commands it states:

    'typeset'
    typeset [-afFrxi] [-p] [NAME[=VALUE] ...]
    The 'typeset' command is supplied for compatibility with the Korn shell; however, it has been deprecated in favor of the 'declare' builtin command.

提交回复
热议问题