#!/bin/bash OS=$(uname) if [ "$1" = "paste" ]; then if [ "$OS" = "Darwin" ]; then pbpaste else xsel -ob fi else content=$(cat -) if [ "$OS" = "Darwin" ]; then echo -n "$content" | pbcopy else echo -n "$content" | xsel -ib fi fi