snippetbashTip
bash — Bourne-Again SHell, an `sh`-compatible command-line interpreter. See also: `zsh`, `!`. More informat
Viewed 0 times
shellcommandagaincompatibleclibashbourne
Problem
How to use the
bash command: Bourne-Again SHell, an sh-compatible command-line interpreter. See also: zsh, !. More information: <https://www.gnu.org/software/bash/manual/bash.html#Invoking-Bash>.Solution
bash — Bourne-Again SHell, an sh-compatible command-line interpreter. See also: zsh, !. More information: <https://www.gnu.org/software/bash/manual/bash.html#Invoking-Bash>.Start an interactive shell session:
bashStart an interactive shell session without loading startup configs:
bash --norcExecute specific [c]ommands:
bash -c "{{echo 'bash is executed'}}"Execute a specific script:
bash {{path/to/script.sh}}E[x]ecute a specific script, printing each command before executing it:
bash -x {{path/to/script.sh}}Execute a specific script and stop at the first [e]rror:
bash -e {{path/to/script.sh}}Execute specific commands from
stdin:{{echo "echo 'bash is executed'"}} | bashStart a [r]estricted shell session:
bash {{[-r|--restricted]}}Code Snippets
Start an interactive shell session
bashStart an interactive shell session without loading startup configs
bash --norcExecute specific [c]ommands
bash -c "{{echo 'bash is executed'}}"Execute a specific script
bash {{path/to/script.sh}}E[x]ecute a specific script, printing each command before executing it
bash -x {{path/to/script.sh}}Context
tldr-pages: common/bash
Revisions (0)
No revisions yet.