diff options
author | Benedikt Böhm <bb@xnull.de> | 2009-04-02 10:23:43 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2009-06-23 04:41:14 +0200 |
commit | 11c27519f84c8b9e35da4ba35daea90193fc7af6 (patch) | |
tree | 10d9d4243f4c0ef294c80b73703cf2c20e114601 /bashrc | |
parent | a38692c5b380de933a0e9ff90aa605e61490fadd (diff) | |
download | dotfiles-11c27519f84c8b9e35da4ba35daea90193fc7af6.tar.gz dotfiles-11c27519f84c8b9e35da4ba35daea90193fc7af6.tar.xz dotfiles-11c27519f84c8b9e35da4ba35daea90193fc7af6.zip |
use rbus copy()
Diffstat (limited to '')
-rw-r--r-- | bashrc/common/alias.sh | 8 |
1 files changed, 8 insertions, 0 deletions
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 |