Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
13
Help us understand the problem. What is going on with this article?
@bunzaemon

cygwin, linux で pbcopy/pbpaste

More than 5 years have passed since last update.

cygwin

putclip, getclip ってのがある。
仮に無いとしても、/dev/clipboard を閲覧すれば良い。

alias pbcopy='cat >/dev/clipboard'
alias pbpaste='cat /dev/clipboard'
  • 日本語環境の齟齬云々があるので、必要な人は、nkf など挟む。
  • 改行コード云々も。

linux

CentOS

linux だと xsel が良いらしい1ので、ソースからインストール

$ wget -q http://www.vergenet.net/~conrad/software/xsel/download/xsel-1.2.0.tar.gz
$ tar zxf xsel-1.2.0.tar.gz 
$ cd xsel-1.2.0/
$ ./configure --prefix=${HOME}/cmd
$ make
$ make install
  • ssh 越しに xsel を使用しようとすると、例え、 linux 側だけで完結させるつもりでも、結構工夫が必要っぽい。今の所は必要としないので、そのまま使う。

で、

.*shrc

case ${OSTYOE} in
    darwin*)
        :
        ;;
    cygwin*)
        alias pbpaste=/usr/bin/getclip.exe
        alias pbcopy=/usr/bin/putclip.exe
        ;;
    *)
        alias pbpaste='xsel -b'
        alias pbcopy='xsel -b'
        ;;
esac

的な事を書いとく。


  1. xclip は日本語が駄目だとかなんとか。今の時点では違うのかもしれないが。 

13
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
13
Help us understand the problem. What is going on with this article?