From e7eae6c77237142902d2dfee3da821cac8e1ae01 Mon Sep 17 00:00:00 2001 From: Emily Grace Seville Date: Fri, 19 Aug 2022 10:53:37 +1000 Subject: [PATCH] bash: refresh page (#7980) * Refresh a page: - better grammar - better token syntax * Simplify `-s` example --- pages/common/bash.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/pages/common/bash.md b/pages/common/bash.md index 22863c5551..aba1c4bcb7 100644 --- a/pages/common/bash.md +++ b/pages/common/bash.md @@ -1,33 +1,33 @@ # bash > Bourne-Again SHell, an `sh`-compatible command-line interpreter. -> See also `histexpand` for history expansion. +> See also: `zsh`, `histexpand` (history expansion). > More information: . - Start an interactive shell session: `bash` -- Execute a command and then exit: +- Start an interactive shell session without loading startup configs: -`bash -c "{{command}}"` +`bash --norc` -- Execute a script: +- Execute specific [c]ommands: + +`bash -c "{{echo 'bash is executed'}}"` + +- Execute a specific script: `bash {{path/to/script.sh}}` -- Execute a script, printing each command before executing it: +- Execute a specific script while printing each command before executing it: `bash -x {{path/to/script.sh}}` -- Execute commands from a script, stopping at the first error: +- Execute a specific script and stop at the first [e]rror: `bash -e {{path/to/script.sh}}` -- Read and execute commands from stdin: +- Execute specific commands from stdin: -`bash -s` - -- Print the Bash version (`$BASH_VERSION` contains the version without license information): - -`bash --version` +`{{echo "echo 'bash is executed'"}} | bash`