Add bin/copy

This commit is contained in:
2025-10-23 09:16:01 +02:00
parent a4d569484d
commit abd93661fb

18
bin/copy Normal file
View File

@@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -e
set -u
if hash pbcopy 2>/dev/null; then
exec pbcopy
elif hash xclip 2>/dev/null; then
exec xclip -selection clipboard
elif hash putclip 2>/dev/null; then
exec putclip
else
rm -f /tmp/clipboard 2> /dev/null
if [ $# -eq 0 ]; then
cat > /tmp/clipboard
else
cat "$1" > /tmp/clipboard
fi
fi