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

manned-org
bl-ue 2021-04-14 10:07:21 -04:00 committed by GitHub
parent 7755ac87fb
commit 16e4ed5c89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 100 additions and 73 deletions

View File

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

View File

@ -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
pages/common/dash.md Normal file
View File

@ -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`

View File

@ -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}}`

View File

@ -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}}`

View File

@ -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`

View File

@ -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`

View File

@ -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`

View File

@ -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}}`