Skip to content

Instantly share code, notes, and snippets.

@NickCody
Created March 2, 2014 20:36
Show Gist options
  • Save NickCody/9313411 to your computer and use it in GitHub Desktop.
Save NickCody/9313411 to your computer and use it in GitHub Desktop.
Scala Script vs. Bash Script
schedulerClassName="Gt4Scheduler"
status() {
lines=$(jps -l | fgrep $schedulerClassName)
if [ $? -eq 0 ]; then
echo "$lines"
else
echo "Not running"
fi
return 0
}
val schedulerClassName="Gt4Scheduler"
def status: Int = {
try {
val lines = (Seq("jps", "-l") #> Seq("fgrep", schedulerClassName)).!!
print(lines)
} catch {
case rte: java.lang.RuntimeException =>
println("Not running")
}
OK
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment