From 3e14fef155e5d04441072f660c932be586835a9e Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Wed, 2 Nov 2022 20:02:36 -0700 Subject: [PATCH] Created SC2118 (markdown) --- SC2118.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 SC2118.md diff --git a/SC2118.md b/SC2118.md new file mode 100644 index 0000000..a17d52d --- /dev/null +++ b/SC2118.md @@ -0,0 +1,26 @@ +## Ksh does not support `|&`. Use `2>&1 |` + +### Problematic code: + +```sh +#!/usr/bin/ksh +make |& tee ~/log +``` + +### Correct code: + +```sh +#!/usr/bin/ksh +make 2>&1 | tee ~/log +``` +### Rationale: + +You are using the Bash specific shorthand `|&`, but your script is running with Ksh. Rewrite it to its full, POSIX-compatible form as shown in the example. + +### Exceptions: + +None + +### Related resources: + +* Help by adding links to BashFAQ, StackOverflow, man pages, POSIX, etc! \ No newline at end of file