From e8a69508c900f92cf7a4801f33f22fa50a576e2c Mon Sep 17 00:00:00 2001 From: Emily Grace Seville Date: Sun, 8 Jan 2023 01:25:25 +1000 Subject: [PATCH] zsh: refresh page (#7990) * Refresh a page: - better grammar - better token syntax * Add reading from stdin example * Apply suggestions from code review Co-authored-by: CleanMachine1 <78213164+CleanMachine1@users.noreply.github.com> * Make page consistent with `pwsh` page * Update pages/common/zsh.md Co-authored-by: K.B.Dharun Krishna Co-authored-by: CleanMachine1 <78213164+CleanMachine1@users.noreply.github.com> Co-authored-by: K.B.Dharun Krishna --- pages/common/zsh.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/pages/common/zsh.md b/pages/common/zsh.md index 67b6bd98b8..0af599ebd0 100644 --- a/pages/common/zsh.md +++ b/pages/common/zsh.md @@ -1,22 +1,30 @@ # zsh > Z SHell, a Bash-compatible command-line interpreter. -> See also `histexpand` for history expansion. +> See also: `bash`, `histexpand`. > More information: . - Start an interactive shell session: `zsh` -- Execute a command and then exit: +- Execute specific [c]ommands: -`zsh -c "{{command}}"` +`zsh -c "{{echo Hello world}}"` -- Execute a script: +- Execute a specific script: `zsh {{path/to/script.zsh}}` -- Execute a script, printing each command before executing it: +- Check a specific script for syntax errors without executing it: + +`zsh --no-exec {{path/to/script.zsh}}` + +- Execute specific commands from stdin: + +`{{echo Hello world}} | zsh` + +- Execute a specific script, printing each command in the script before executing it: `zsh --xtrace {{path/to/script.zsh}}`