awrb opened a new pull request, #1712:
URL: https://github.com/apache/karaf/pull/1712
Added two commands that activate when groovy feature is installed:
```
karaf@root()> groovy:exec --help
DESCRIPTION
groovy:exec
Executes Groovy code
SYNTAX
groovy:exec script [args]
ARGUMENTS
script
Groovy code
(required)
args
Arguments in the format of key=value
karaf@root()> groovy:exec-file --help
DESCRIPTION
groovy:exec-file
Executes Groovy file
SYNTAX
groovy:exec-file path
ARGUMENTS
path
Groovy script file path
(required)
karaf@root()> groovy:exec "1+1"
2
karaf@root()> groovy:exec "(x as int) + (y as int)" x=1 y=2
3
karaf@root()> cat /home/aleksy/test.groovy
def add(x, y) {
return x + y
}
add(1,2)
karaf@root()> groovy:exec-file /home/aleksy/test.groovy
3
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]