Created
September 12, 2014 08:46
-
-
Save menghan/819859936bc43d5c7e14 to your computer and use it in GitHub Desktop.
let the second cat get stdin
This file contains hidden or 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
#!/usr/bin/env bash | |
exec 4</dev/null | |
exec 5<&0 | |
exec 0<&4 | |
echo cat1 | |
cat | |
echo cat2 | |
cat <&5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment