Skip to content

Instantly share code, notes, and snippets.

@nemo-kaz
Created June 24, 2012 04:37
Show Gist options
  • Save nemo-kaz/2981644 to your computer and use it in GitHub Desktop.
Save nemo-kaz/2981644 to your computer and use it in GitHub Desktop.
dentaku 電卓
#!/usr/bin/groovy
import groovy.util.Eval
if (args.length ==0) {
println """Groovy電卓 使用例: dentaku 1+2*3
第一引数に 計算式をスペース無しで指定してください"""
return
}
def eval = new Eval()
println eval.me(args[0])
// 動作イメージ
// >dentaku.groovy 1+2*3
// >7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment