Created SC2118 (markdown)

Vidar Holen
2022-11-02 20:02:36 -07:00
parent 5f35a2352a
commit 3e14fef155

26
SC2118.md Normal file

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