-
-
Save dtoebe/74fb2479410e8567259b12f677e52710 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