管道/从剪贴板中 [英] Pipe to/from Clipboard
问题描述
是否有可能管/从庆典
剪贴板?无论是管道向/从设备手柄或使用辅助应用程序,我无法找到任何东西。
例如,如果的/ dev /夹
是链接到剪贴板中,我们可以做一个装置:
猫的/ dev /剪辑#转储剪贴板中的内容
猫富>为/ dev /剪辑#倾倒富的内容到剪贴板
您是一个小暧昧。我希望你可能一个Linux用户里面点¯x谁愿意把东西在X 主要
剪贴板。
明白,庆典
没有一个剪贴板是很重要的。有作为的剪贴板没有这样的事情,因为庆典
可在Windows,Mac OS X,许多其他操作系统的,里面X,外面X,跑...不一提的是X本身有三种不同的剪贴板。有丰富的,你可能要处理的剪贴板。通常你想谈论到剪贴板有一个工具,可以让你随便吧。
在的X情况下,是的,有 XCLIP
(及其他)。 XCLIP -selectionç
将数据发送到与按Ctrl-C,Ctrl-V键在大多数应用剪贴板。
如果你想交谈的Mac OS X的剪贴板中,有 pbcopy
。
如果你在Linux终端模式(没有X),那么也许你需要寻找到 GPM
。
还有 GNU 屏幕
其中有一个剪贴板。为了把东西在里面,看屏幕
命令 READREG
在Windows / cygwin的,使用的/ dev /剪贴板
。
Is it possible to pipe to/from the clipboard in bash
? Whether it is piping to/from a device handle or using an auxiliary application, I can't find anything.
For example, if /dev/clip
was a device linking to the clipboard we could do:
cat /dev/clip # dump the contents of the clipboard
cat foo > /dev/clip # dump the contents of "foo" into the clipboard
You're a little ambiguous. I expect you're probably a Linux user inside X who wants to put stuff in the X PRIMARY
clipboard.
It's important to understand that bash
doesn't have a clipboard. There is no such thing as "the" clipboard, because bash
can run on Windows, Mac OS X, lots of other OSes, inside X, outside X, ... Not to mention that X itself has three different clipboards. There's a wealth of clipboards you could be dealing with. Usually the clipboard you want to talk to has a utility that lets you talk to it.
In case of X, yes, there's xclip
(and others). xclip -selection c
will send data to the clipboard that works with Ctrl-C, Ctrl-V in most applications.
If you're trying to talk to the Mac OS X clipboard, there's pbcopy
.
If you're in Linux terminal mode (no X) then maybe you need to look into gpm
.
There's also GNU screen
which has a clipboard. To put stuff in there, look at the screen
command "readreg
".
Under Windows/cygwin, use /dev/clipboard
.
这篇关于管道/从剪贴板中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!