-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dd: open stdout from file descriptor when possible
Open stdout using its file descriptor so that a `dd skip=N` command in a subprocess does not close stdout. For example, before this commit, multiple instances of `dd` writing to stdout and appearing in a single command line could incorrectly result in an empty stdout for each instance of `dd` after the first: $ printf "abcde\n" | (dd bs=1 skip=1 count=1 && dd bs=1 skip=1) 2> /dev/null b After this commit, each `dd` process writes to the file descriptor referring to stdout: $ printf "abcde\n" | (dd bs=1 skip=1 count=1 && dd bs=1 skip=1) 2> /dev/null bde
- Loading branch information
Showing
2 changed files
with
62 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters