Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

A quick way to save clipboard contents to a file UNIX

A bit of an expansion on this hint... add this to your ~/.[t]cshrc file:


alias save 'pbpaste > \!^ && echo "" >> \!^'
And now if you select some text in a window, copy it, and want to save it into a file, type save /path/to/file and there it is. The !^ is a bit of history substitution that means "take the first argument from the last command." In this case, the last command was save and the first argument was the file path entered after.

The echo part adds a new line to the end of the file and can be omitted.
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[5,311 views]  

A quick way to save clipboard contents to a file | 1 comments | Create New Account
Click here to return to the 'A quick way to save clipboard contents to a file' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A quick way to save clipboard contents to a file
Authored by: hedgepig on Jan 30, '04 12:36:25PM
how would someone write image data from the clipboard to a file.
it is easy to write text with
'pbpaste > somefile.txt'
but the same doesn't work for images in the clipbard.

any ideas?

[ Reply to This | # ]