1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-22 10:22:08 +02:00
tldr/pages/common/$.md
Managor ac3c978a0f
<, >, |, $: add page (#13846)
Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com>
Co-authored-by: Wiktor Perskawiec <git@spageektti.cc>
Co-authored-by: Lena <126529524+acuteenvy@users.noreply.github.com>
2024-10-01 19:20:05 +02:00

468 B

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}})