From e5ee6ba5322dca2f86fe4c7325013481080e04f7 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Tue, 21 Aug 2012 19:09:45 +0900 Subject: [PATCH] fix clip func for mac --- bashrc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bashrc b/bashrc index bd17951..8eb0b3f 100755 --- a/bashrc +++ b/bashrc @@ -298,6 +298,9 @@ catclip(){ if iswindows then cat /dev/clipboard | tr -d \\r + elif isdarwin + then + pbpaste else xclip -o -selection "clipboard" fi @@ -312,6 +315,14 @@ setclip(){ else cat "$@" | sed -e 's/$/\r/' | tee /dev/clipboard fi + elif isdarwin + then + if test $# -eq 0 + then + pbcopy + else + cat "$@" | pbcopy + fi else if test $# -eq 0 then