Updated SC2176 (markdown)

Vidar Holen
2018-07-26 11:07:56 -07:00
parent 53c8c0d458
commit 669921864f

@@ -3,7 +3,8 @@
### Problematic code:
```sh
time foo | bar```
time foo | bar
```
### Correct code:
@@ -19,7 +20,7 @@ To time everything in a pipeline:
time bash -c 'foo | bar'
```
Note that you can not `time sh -c` to time an entire pipeline, because POSIX does not guarantee that anything other than the last stage is waited on and therefore be recursively counted in the `times()` call that `time` depends on.
Note that you can not use `time sh -c` to time an entire pipeline, because POSIX does not guarantee that anything other than the last stage is waited upon by the shell.
### Rationale:
@@ -27,4 +28,4 @@ This behavior is explicitly left undefined [in POSIX](http://pubs.opengroup.org/
### Exceptions:
None. This method is not given in `ksh` or `bash` where `time` is defined for pipelines.
None. This warning is not emitted in `ksh` or `bash` where `time` is defined for pipelines.