Skip to content

Instantly share code, notes, and snippets.

@hyrsky
Last active August 15, 2018 12:50
Show Gist options
  • Save hyrsky/62f773e35e32fc5d83ecfd916e3e12da to your computer and use it in GitHub Desktop.
Save hyrsky/62f773e35e32fc5d83ecfd916e3e12da to your computer and use it in GitHub Desktop.
xclip on Windows subsystem for Linux
#!/bin/bash
# Purpose of this script is to eats all command line parameters and error messages
# Location: /usr/local/bin/xclip
# Just exit if -o flag is set
while [[ $# -gt 1 ]]; do
case "$1" in
-o ) exit 0 ;;
* ) echo $1; shift ;;
esac
done
input=`cat -`
echo "$input" | clip.exe 2>/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment