Move pages under tldr, lint run.sh, update docs

This commit is contained in:
2024-02-21 13:58:43 +02:00
parent 3d653cc7e6
commit 2c475fa62d
4806 changed files with 36 additions and 35 deletions

33
tldr/typeset Normal file
View File

@@ -0,0 +1,33 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# typeset
> Declare variables and give them attributes.
> More information: <https://www.gnu.org/software/bash/manual/bash.html#Bash-Builtins>.
- Declare a string variable with the specified value:
`typeset {{variable}}="{{value}}"`
- 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}}"`