Read from stdin
Read lines from stdin and print in on stdout. Terminate the program when “exit” is entered.
System.in.eachLine() { line ->
if(line.equals("exit"))
System.exit()
else
println "you entered: $line"
}
Read lines from stdin and print in on stdout. Terminate the program when “exit” is entered.
System.in.eachLine() { line ->
if(line.equals("exit"))
System.exit()
else
println "you entered: $line"
}