mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-03-15 15:00:07 +00:00
Update cheatsheets
This commit is contained in:
29
tldr/$
Normal file
29
tldr/$
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# Dollar sign
|
||||
|
||||
> Expand a bash variable.
|
||||
> More information: <https://gnu.org/software/bash/manual/bash.html#Shell-Variables>.
|
||||
|
||||
- Print a variable:
|
||||
|
||||
`echo ${{VARIABLE}}`
|
||||
|
||||
- Print the exit status of the previous command:
|
||||
|
||||
`echo $?`
|
||||
|
||||
- Print a random number between 0 and 32767:
|
||||
|
||||
`echo $RANDOM`
|
||||
|
||||
- Print one of the prompt strings:
|
||||
|
||||
`echo ${{PS1|PS2|PS3|PS4}}`
|
||||
|
||||
- Expand with the output of `command` and run it. Same as enclosing `command` in backtics:
|
||||
|
||||
`$({{command}})`
|
||||
Reference in New Issue
Block a user