From 11c27519f84c8b9e35da4ba35daea90193fc7af6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benedikt=20B=C3=B6hm?= Date: Thu, 2 Apr 2009 10:23:43 +0200 Subject: use rbus copy() --- bashrc/common/alias.sh | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'bashrc/common') diff --git a/bashrc/common/alias.sh b/bashrc/common/alias.sh index c1e9b6b..5d73269 100644 --- a/bashrc/common/alias.sh +++ b/bashrc/common/alias.sh @@ -34,6 +34,14 @@ mkcd() { mkdir -p $1 && cd $1 } +# encode files suitable for copy&paste into other terminals +copy() { + STR=$(tar cj $@ | perl -MMIME::Base64 -e 'print MIME::Base64::encode(join("", <>))' - ; exit $PIPESTATUS) || return $? + echo "cat << E=O=F | perl -MMIME::Base64 -e 'print MIME::Base64::decode(join(\"\", <>))' - | tar xj" + echo "$STR" + echo "E=O=F" +} + # create tarball of one directory mktar() { [[ -z "$1" ]] && return 1 -- cgit v1.2.3