本文介绍了相当于OS X的xsel -o的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在'xsel -o'适用于Linux的情况下,是否有等效的解决方案可在OS X中抓取选定的文本?
Is there an equivalent solution to grab selected text in OS X as 'xsel -o' works for Linux?
只需要当前选择,就可以在shell脚本中使用文本.
Just need the current selection so I can use the text in shell script.
干杯,埃里克
推荐答案
您可能可以在MacOS上安装xsel
. (更新:根据Arkku的评论,只有在运行X11服务器并将其同步到OS X粘贴板的情况下,该方法才有效.)
You can probably install xsel
on MacOS. (UPDATE: According to Arkku's comment, that will only work if you have the X11 server running and synchronized to the OS X pasteboard.)
如果没有,则Google快速搜索会显示pbcopy
/pbpaste
,这显然是预先安装的.
If not, a quick Google search turns up pbcopy
/ pbpaste
, which apparently is pre-installed.
链接: https://github.com/raymontag/keepassc/issues/59
这篇关于相当于OS X的xsel -o的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!