Skip to content

Instantly share code, notes, and snippets.

@orkaa
Created March 21, 2016 00:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save orkaa/717138e2fb68b47d4b52 to your computer and use it in GitHub Desktop.
Save orkaa/717138e2fb68b47d4b52 to your computer and use it in GitHub Desktop.
#!/usr/bin/env coffee
exec = require('child_process').exec
getConfig = (cmd) ->
child = exec(cmd, (error, stdout, stderr) ->
if stderr or error
console.log 'stderr: ' + stderr
console.log 'error: ' + error
result = stdout.toString()
return result
)
krneki = getConfig 'ls -al'
console.log krneki
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment