My last article showed how to interface with the clipboard in Mac OS X. Windows 7 comes with the same feature, but instead of pbcopy it’s simply clip. Since you don’t ls, we’ll pipe the output of dir into the clipboard: dir | clip Enjoy & no more complaining that I like one platform more than the other – you know who you are!
-
-
Shell to Clipboard & Back Again
Many times I want to send data straight into the clipboard from a command or script and I don’t really want to have to mess with manually lasso’ing text, using Command-C, etc. What can I say, I’m kinda’ lazy (or working too much, not really sure which). Apple has been kind enough to supply us with a pair of really useful tools for interfacing with the clipboard (er, pasteboard) in Mac OS X: pbcopy and pbpaste. To use pbcopy, which copies text into the pasteboard, simply pipe data to it. For example, if you want to send a directory listing that you run in a script into the pasteboard, you…