1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-08-04 20:55:34 +02:00

typeset: convert to alias (#15231)

This commit is contained in:
Managor 2024-12-21 19:42:02 +02:00 committed by GitHub
parent 78d6239326
commit 42a0f40446
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,28 +1,7 @@
# typeset # typeset
> Declare variables and give them attributes. > This command is an alias of `declare`.
> More information: <https://www.gnu.org/software/bash/manual/bash.html#Bash-Builtins>.
- Declare a string variable with the specified value: - View documentation for the original command:
`typeset {{variable}}="{{value}}"` `tldr declare`
- Declare an integer variable with the specified value:
`typeset -i {{variable}}="{{value}}"`
- Declare an array variable with the specified value:
`typeset {{variable}}=({{item_a item_b item_c}})`
- Declare an associative array variable with the specified value:
`typeset -A {{variable}}=({{[key_a]=item_a [key_b]=item_b [key_c]=item_c}})`
- Declare a readonly variable with the specified value:
`typeset -r {{variable}}="{{value}}"`
- Declare a global variable within a function with the specified value:
`typeset -g {{variable}}="{{value}}"`