github-gist
github-gist copied to clipboard
`xsel -ib` has no effect when shell script stdout or stderr is closed with `>&-` or `2>&-`
xsel version 1.2.0
arch linux, 5.15.2-arch1-1
I have a script called test
:
#!/bin/sh
echo 'haha' | xsel -ib
If I run test >&-
or test 2>&-
, string "haha" is not copied to clipboard.
Is it intended? I'm not sure if this is a bug. However, xclip
does't have this problem.