I want to get the data from the main clipboard onto my own file so that when the user executes a command they can retrieve the information set upon that second file. Alternatively I could also pbcopy
direcly into the second file and run that command with pbpaste
. Could someone smarter than me tell me how to do this. I have searched for hours now.
Asked
Active
Viewed 375 times
0

Wim Lewis
- 392
- 1
- 9

Carla Rivers
- 63
- 1
- 7
1 Answers
0
pbpaste
reads from the clipboard/pasteboard and writes to stdout (as if you are pasting), so you can copy your pasteboard to a file using pbpaste > filename
. You can then do whatever you want with the file. pbcopy
puts something onto the pasteboard, so if you want to put a file's contents into the pasteboard you can do that with pbcopy < filename
.
The <
and >
operators are shell redirection operators, which you can learn more about in a command-line or unix tutorial.

Wim Lewis
- 392
- 1
- 9