...
The current version of Groosh is 0.3.56
Team Members
- Yuri Schimke - Founder and original contributor
- Alexander Egger [alexander.egger at gmail.com] - Current maintainer
...
| Code Block |
|---|
@Grapes([ @Grab(group='org.codehaus.groovy.modules.groosh',module='groovy-groosh',version='[0.3.56,)'), @GrabConfig(systemClassLoader=true) ]) import groosh.Groosh Groosh.withGroosh(this) ls() >> stdout |
...
| Code Block |
|---|
//Read a text file and write it to stdout @Grapes([ @Grab(group='org.codehaus.groovy.modules.groosh',module='groovy-groosh',version='[0.3.56,)'), @GrabConfig(systemClassLoader=true) ]) import groosh.Groosh Groosh.withGroosh(this) cat('test_scripts/blah.txt') >> stdout |
...
| Code Block |
|---|
//Count the lines of all .java files in this directory and all its subdirectories. //Write the total number of lines to stdout. @Grapes([ @Grab(group='org.codehaus.groovy.modules.groosh',module='groovy-groosh',version='[0.3.56,)'), @GrabConfig(systemClassLoader=true) ]) import groosh.Groosh Groosh.withGroosh(this) def f = find('.', '-name', '*.java', '-ls') def total = 0 def lines = grid { values,w -> def x = values[2,4,6,10] def s = x.join(' ') w.println(s) total += Integer.parseInt(values[6]) } f | lines lines >> stdout println "Total: ${total}" |
...