Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xsel -o equivalent for OS X

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

like image 318
Erik Lundmark Avatar asked Dec 25 '22 22:12

Erik Lundmark


1 Answers

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

like image 152
Keith Thompson Avatar answered Jan 05 '23 16:01

Keith Thompson