Created
March 2, 2014 20:36
-
-
Save NickCody/9313411 to your computer and use it in GitHub Desktop.
Scala Script vs. Bash Script
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
schedulerClassName="Gt4Scheduler" | |
status() { | |
lines=$(jps -l | fgrep $schedulerClassName) | |
if [ $? -eq 0 ]; then | |
echo "$lines" | |
else | |
echo "Not running" | |
fi | |
return 0 | |
} | |
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
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