Last active
August 29, 2015 14:03
-
-
Save dguzzo/07e6bde0e02eb80859d9 to your computer and use it in GitHub Desktop.
simple Node.js execute unix command and copy to clipboard
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// inspired by http://www.dzone.com/snippets/execute-unix-command-nodejs | |
var exec = require('child_process').exec; | |
var someValue = "contrived: " + 2 * 2; | |
exec('echo "' + someValue + '" | pbcopy'); // "contrived: 4" is now in your clipboard. WARNING: this is destructive, and an overwrite something important if you're not careful. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment