Last active
September 1, 2020 16:10
-
-
Save xiaq/042aca2a7210fb00c4487337cf79632f to your computer and use it in GitHub Desktop.
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
cat > a.go <<EOF | |
package main | |
import ( | |
"fmt" | |
"io" | |
"os" | |
) | |
func main() { | |
fmt.Println(os.Args[1:]) | |
io.Copy(os.Stdout, os.NewFile(3, "fd 3")) | |
io.Copy(os.Stdout, os.NewFile(4, "fd 4")) | |
} | |
EOF | |
go run a.go 3<<FD3 4<<FD4 more arguments | |
This is FD 3 | |
FD3 | |
This is FD 4 | |
FD4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment