Skip to content

Commit

Permalink
Merge pull request #679 from honnix/patch-1
Browse files Browse the repository at this point in the history
[doc] Add example for Piping to STDIN migration
  • Loading branch information
amoffat committed Jun 23, 2023
2 parents cdde901 + 39dd2ec commit 6145cbb
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,28 @@ Previously, if the first argument of a sh command was an instance of `RunningCom
it was automatically fed into the process's STDIN. This is no longer the case and you
must explicitly use `_in=`.

```python
from sh import wc,ls

print(wc(ls("/home/<user>", "-l"), "-l"))
```

Becomes:

```python
from sh import wc,ls

print(wc("-l", _in=ls("/home/<user>", "-l")))
```

Or:

```python
from sh import wc,ls

print(wc("-l", _in=ls("/home/<user>", "-l", _return_cmd=True)))
```

### Workaround

None
Expand Down

0 comments on commit 6145cbb

Please sign in to comment.