#!/usr/bin/env bash read contents if [[ -x `which wl-copy` ]]; then echo "$contents" | wl-copy else echo "$contents" | xclip -selection clipboard fi