将Shell脚本输出复制到剪贴板 [英] Copy shell script output to clipboard

查看:473
本文介绍了将Shell脚本输出复制到剪贴板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何简单的方法可以从Shell脚本的输出中实现复制到剪贴板"选项?

Is there any easy way to implement the copy to clipboard option from the output of a shell script ?

推荐答案

这可能取决于您所使用的环境.至少使用Gnome(我没有尝试过其他工具,但可能会起作用),您可以通过以下方式传递输出:

That may depend on the environment you're using. With Gnome at least (I haven't tried the others but it may work), you can pipe your output as follows:

echo 123 | xclip
echo 123 | xclip -sel clip

第一个进入鼠标剪贴板,第二个进入普通"剪贴板.

The first goes to the mouse clipboard, the second to the "normal" clipboard.

这篇关于将Shell脚本输出复制到剪贴板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆