Created
October 18, 2016 15:13
-
-
Save shogonir/ca74a5799e52d1a3ab44136626deb852 to your computer and use it in GitHub Desktop.
This file contains 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
package process | |
import scala.sys.process._ | |
/** | |
* Created by shogo on 2016/10/19. | |
*/ | |
object ProcessSample { | |
def main(args: Array[String]) { | |
try { | |
val output = Process("datadog-agent status") !!; | |
// exit zero status code | |
// datadog-agent is installed | |
println(output) | |
} catch { | |
case e: Throwable => | |
println("err, " + e.getMessage) | |
// exit non zero status code | |
// command not found | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment