xsel -o equivalent for OS X

2020-07-24 05:18发布

Is there an equivalent solution to grab selected text in OS X as 'xsel -o' works for Linux?

Just need the current selection so I can use the text in shell script.

Cheers, Erik

1条回答
Rolldiameter
2楼-- · 2020-07-24 05:40

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.)

If not, a quick Google search turns up pbcopy / pbpaste, which apparently is pre-installed.

Link: https://github.com/raymontag/keepassc/issues/59

查看更多
登录 后发表回答