#!/bin/bash # mc clipboard is ~/.cedit/cooledit.clip # # 1. With no argument, transfers mc clipboard to stdout. # # 2. with argument of filename or "-", loads clipboard # from file or stdin. If that arg is preceded by "-a", # then file or stdin is appended to clipboard, not loaded. #edbuf=~/.mc/cedit/cooledit.clip edbuf=~/.viminfo if [ -z "$1" ]; then cat $edbuf else if [ "$1" = "-a" ]; then shift if [ "$1" = "-" ]; then cat >> $edbuf else cat $1 >> $edbuf fi else if [ "$1" = "-" ]; then cat > $edbuf else cat $1 > $edbuf fi fi fi