mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Updated SC3028 (markdown)
@@ -22,6 +22,12 @@ echo "$(hostname) $(id -u) $(awk 'BEGIN { srand(); print int(rand()*32768) }' /d
|
|||||||
|
|
||||||
The variable you are attempting to use is a special variable in bash or ksh. To get the same information from `dash` or POSIX `sh`, use an external command instead.
|
The variable you are attempting to use is a special variable in bash or ksh. To get the same information from `dash` or POSIX `sh`, use an external command instead.
|
||||||
|
|
||||||
|
For `PIPESTATUS`, the pipeline can be instrumented to record the exit value of each command:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
{ cmd0; echo $? > status0; } | { cmd1; echo $? > status1; } | cmd2
|
||||||
|
```
|
||||||
|
|
||||||
### Exceptions:
|
### Exceptions:
|
||||||
|
|
||||||
If you only intend to target shells that supports this feature, you can change
|
If you only intend to target shells that supports this feature, you can change
|
||||||
|
Reference in New Issue
Block a user