#!/bin/sh _fn() { perl -pe "chomp if eof" | xclip -selection clipboard } if [ -n "$1" ]; then _fn < "$1" else _fn fi