This works:
curl -Ls -o /dev/null -w %{url_effective} $URL | xargs printf "%s" > /dev/clipboard
whereas this doesn't:
curl -Ls -o /dev/null -w %{url_effective} $URL > /dev/clipboard
Why is that?
two possible solutions
curl -Ls -o /dev/null -w %{url_effective} $URL > filename
cat filename > /dev/clipboard
and
curl -Ls -o /dev/null -w %{url_effective} $URL | putclip
putclip
is in
$ cygcheck -f /usr/bin/putclip
cygutils-extra-1.4.16-2
> filename
did work; although I don't understand why the output is seen as multiple items (it's a URL). Thanks. Could you add this as an answer?> filename
, thencat filename > /dev/clipboard
does work as expected...curl -Ls -o /dev/null -w %{url_effective} $URL
exit with something else than success. Trycurl -Ls -o /dev/null -w %{url_effective} $URL || echo -e "\nFAIL'
. Anyway it shouldn't prevent clipboard update. Seems that curl is messing with fd.