From 1bf11c91c4bf21b3e23265c003e573f1b0c7b028 Mon Sep 17 00:00:00 2001 From: Stavros Ntentos <133706+stdedos@users.noreply.github.com> Date: Mon, 27 May 2019 15:34:14 +0300 Subject: [PATCH] Add "Redirect both stdout and stderr" --- SC2039.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/SC2039.md b/SC2039.md index 61f4b84..e31cea9 100644 --- a/SC2039.md +++ b/SC2039.md @@ -237,6 +237,20 @@ The only acceptable flags under POSIX sh for `jobs` are `-l` and `-p` ([see spec ``` Although the state of stopped jobs is `Stopped` in Bash and dash, and it's the one specified by POSIX, `Suspended` is also a valid alternative (but Zsh happens to not respect the capitalization, that's why we try to match `suspended`). Similarly, the state of running jobs is `Running` according to POSIX. Bash and dash respect this, but Zsh uses `running`. +### Redirect both stdout and stderr + +Change: +``` +>& and &> +``` + +To: +``` +command > file 2>&1 or command 2>&1 | othercommand +``` + +No Comments / Exceptions + ## Exception Depends on what your expected POSIX shell providers would use. \ No newline at end of file