1
0
mirror of https://github.com/sahinakkaya/dotfiles.git synced 2025-01-18 20:39:37 +01:00
dotfiles/scripts/cpyout

12 lines
171 B
Plaintext
Raw Normal View History

2022-03-17 22:38:39 +01:00
#!/bin/bash
tmpfile=$(mktemp /tmp/cmd-output.XXXXXX)
trap 'rm "$tmpfile"' 0 1 15
echo "\$ $@" | tee $tmpfile
eval "$@" |& tee -a $tmpfile
cat $tmpfile | xclip -sel c