Skip to content

Instantly share code, notes, and snippets.

@menghan
Created September 12, 2014 08:46
Show Gist options
  • Save menghan/819859936bc43d5c7e14 to your computer and use it in GitHub Desktop.
Save menghan/819859936bc43d5c7e14 to your computer and use it in GitHub Desktop.
let the second cat get stdin
#!/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