Created
August 31, 2017 18:59
-
-
Save imiric/4ddd7b669c2ac6642c53d7a4bff070e6 to your computer and use it in GitHub Desktop.
xclip for Cygwin/MSYS2
This file contains hidden or 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
#!/bin/bash | |
# This replicates xclip functionality used by pass in Cygwin/MSYS2 | |
# Original author: https://tylor.io/2015/07/13/password-manager/ | |
while [[ $# > 0 ]] | |
do | |
key="$1" | |
case $key in | |
-o|-out) | |
OUT=1 | |
shift | |
;; | |
*) | |
shift | |
;; | |
esac | |
done | |
if [[ $OUT -eq 0 ]]; then | |
cat - > /dev/clipboard | |
else | |
cat /dev/clipboard | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks, this worked great!