浏览代码

bash, dash, fish, ksh, rbash, sh, zsh: refresh (#5714)

bl-ue 3 年之前
父节点
当前提交
16e4ed5c89
共有 9 个文件被更改,包括 100 次插入73 次删除
  1. 1 0
      pages.sh/common/sh.md
  2. 11 11
      pages/common/bash.md
  3. 28 0
      pages/common/dash.md
  4. 12 9
      pages/common/fish.md
  5. 9 9
      pages/common/ksh.md
  6. 18 8
      pages/common/rbash.md
  7. 9 8
      pages/common/sh.md
  8. 12 8
      pages/common/zsh.md
  9. 0 20
      pages/linux/dash.md

+ 1 - 0
pages.sh/common/sh.md

@@ -2,6 +2,7 @@
 
 > Bourne ljuska.
 > Standardni interpreter komandnog jezika.
+> Više informacija: <https://manned.org/sh>.
 
 - Pokreni interaktivnu ljusku:
 

+ 11 - 11
pages/common/bash.md

@@ -2,32 +2,32 @@
 
 > Bourne-Again SHell, an `sh`-compatible command line interpreter.
 > See also `histexpand` for history expansion.
-> More information: <https://gnu.org/software/bash>.
+> More information: <https://gnu.org/software/bash/>.
 
-- Start interactive shell:
+- Start an interactive shell session:
 
 `bash`
 
-- Execute a command:
+- Execute a command and then exit:
 
 `bash -c "{{command}}"`
 
-- Run commands from a file:
+- Execute a script:
 
-`bash {{file.sh}}`
+`bash {{path/to/script.sh}}`
 
-- Run commands from a file, logging all commands executed to the terminal:
+- Execute a script, printing each command before executing it:
 
-`bash -x {{file.sh}}`
+`bash -x {{path/to/script.sh}}`
 
-- Run commands from a file, stopping at the first error:
+- Execute commands from a script, stopping at the first error:
 
-`bash -e {{file.sh}}`
+`bash -e {{path/to/script.sh}}`
 
-- Run commands from stdin:
+- Read and execute commands from stdin:
 
 `bash -s`
 
-- Print the version information of bash (use `echo $BASH_VERSION` to show just the version without license information):
+- Print the Bash version (`$BASH_VERSION` contains the version without license information):
 
 `bash --version`

+ 28 - 0
pages/common/dash.md

@@ -0,0 +1,28 @@
+# dash
+
+> Debian Almquist Shell, a modern, POSIX-compliant implementation of `sh` (not Bash-compatible).
+> More information: <https://manned.org/dash>.
+
+- Start an interactive shell session:
+
+`dash`
+
+- Execute a command and then exit:
+
+`dash -c "{{command}}"`
+
+- Execute a script:
+
+`dash {{path/to/script.sh}}`
+
+- Run commands from a script, printing each command before executing it:
+
+`dash -x {{path/to/script.sh}}`
+
+- Execute commands from a script, stopping at the first error:
+
+`dash -e {{path/to/script.sh}}`
+
+- Read and execute commands from stdin:
+
+`dash -s`

+ 12 - 9
pages/common/fish.md

@@ -1,29 +1,32 @@
 # fish
 
-> The Friendly Interactive SHell.
-> A command-line interpreter designed to be user friendly.
+> The Friendly Interactive SHell, a command-line interpreter designed to be user friendly.
 > More information: <https://fishshell.com>.
 
-- Start interactive shell:
+- Start an interactive shell session:
 
 `fish`
 
-- Execute a command:
+- Execute a command and then exit:
 
 `fish -c "{{command}}"`
 
-- Run commands from a file:
+- Execute a script:
 
-`fish {{file.fish}}`
+`fish {{path/to/script.fish}}`
 
-- Check a file for syntax errors:
+- Check a script for syntax errors:
 
-`fish --no-execute {{file.fish}}`
+`fish --no-execute {{path/to/script.fish}}`
+
+- Start an interactive shell session in private mode, where the shell does not access old history or save new history:
+
+`fish --private`
 
 - Display version information and exit:
 
 `fish --version`
 
-- Set and export environmental variables that persist across restarts:
+- Set and export environmental variables that persist across shell restarts (from within the shell only):
 
 `set -Ux {{variable_name}} {{variable_value}}`

+ 9 - 9
pages/common/ksh.md

@@ -1,21 +1,21 @@
 # ksh
 
-> Korn Shell.
-> `bash` and `sh`-compatible command line interpreter.
+> Korn Shell, a Bash-compatible command line interpreter.
+> See also `histexpand` for history expansion.
 > More information: <http://kornshell.com>.
 
-- Start interactive command line interpreter:
+- Start an interactive shell session:
 
 `ksh`
 
-- Execute a command:
+- Execute a command and then exit:
 
-`ksh -c {{command}}`
+`ksh -c "{{command}}"`
 
-- Run commands from a file:
+- Execute a script:
 
-`ksh {{file}}`
+`ksh {{path/to/script.ksh}}`
 
-- Run commands from a file and print them as they are executed:
+- Execute a script, printing each command before executing it:
 
-`ksh -x {{file}}`
+`ksh -x {{path/to/script.ksh}}`

+ 18 - 8
pages/common/rbash.md

@@ -1,20 +1,30 @@
 # rbash
 
-> Restricted Bash shell.
-> Similar to the `bash` shell with some restrictions like changing directories with `cd`, setting/unsetting of PATH, ENV variables and others.
+> Restricted Bash shell, equivalent to `bash --restricted`.
+> Does not permit changing the working directory, redirecting command output, or modifying environment variables, among other things.
+> See also `histexpand` for history expansion.
+> More information: <https://www.gnu.org/software/bash/manual/html_node/The-Restricted-Shell>.
 
-- Start rbash:
+- Start an interactive shell session:
 
 `rbash`
 
-- Execute a command:
+- Execute a command and then exit:
 
 `rbash -c "{{command}}"`
 
-- Run commands from a file:
+- Execute a script:
 
-`rbash {{file.sh}}`
+`rbash {{path/to/script.sh}}`
 
-- Print the version information of rbash:
+- Execute a script, printing each command before executing it:
 
-`rbash --version`
+`rbash -x {{path/to/script.sh}}`
+
+- Execute commands from a script, stopping at the first error:
+
+`rbash -e {{path/to/script.sh}}`
+
+- Read and execute commands from stdin:
+
+`rbash -s`

+ 9 - 8
pages/common/sh.md

@@ -1,20 +1,21 @@
 # sh
 
-> Bourne shell.
-> The standard command language interpreter.
+> Bourne shell, the standard command language interpreter.
+> See also `histexpand` for history expansion.
+> More information: <https://manned.org/sh>.
 
-- Start interactive shell:
+- Start an interactive shell session:
 
 `sh`
 
-- Execute a command:
+- Execute a command and then exit:
 
-`sh -c {{command}}`
+`sh -c "{{command}}"`
 
-- Run commands from a file:
+- Execute a script:
 
-`sh {{file.sh}}`
+`sh {{path/to/script.sh}}`
 
-- Run commands from stdin:
+- Read and execute commands from stdin:
 
 `sh -s`

+ 12 - 8
pages/common/zsh.md

@@ -1,21 +1,25 @@
 # zsh
 
-> Z SHell, a `bash` and `sh`-compatible command line interpreter.
+> Z SHell, a Bash-compatible command line interpreter.
 > See also `histexpand` for history expansion.
 > More information: <https://www.zsh.org>.
 
-- Start interactive command line interpreter:
+- Start an interactive shell session:
 
 `zsh`
 
-- Execute command passed as parameter:
+- Execute a command and then exit:
 
-`zsh -c {{command}}`
+`zsh -c "{{command}}"`
 
-- Run commands from file (script):
+- Execute a script:
 
-`zsh {{file}}`
+`zsh {{path/to/script.zsh}}`
 
-- Run commands from file and print them as they are executed:
+- Execute a script, printing each command before executing it:
 
-`zsh -x {{file}}`
+`zsh --xtrace {{path/to/script.zsh}}`
+
+- Start an interactive shell session in verbose mode, printing each command before executing it:
+
+`zsh --verbose`

+ 0 - 20
pages/linux/dash.md

@@ -1,20 +0,0 @@
-# dash
-
-> Debian Almquist Shell.
-> Modern POSIX-compliant implementation of `sh` (isn't Bash compatible).
-
-- Start interactive shell:
-
-`dash`
-
-- Execute a command:
-
-`dash -c "{{command}}"`
-
-- Run commands from a file:
-
-`dash {{file.sh}}`
-
-- Run commands from a file, logging all commands executed to the terminal:
-
-`dash -x {{file.sh}}`