Description
Scripting behavior has changed between Karaf v4.0.9 and v4.1.5
The following is a shell session for v4.0.10
Apache Karaf (4.0.10) Hit '<tab>' for a list of available commands and '[cmd] --help' for help on a specific command. Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown Karaf. karaf@root()> a1 = "This is a test" This is a test karaf@root()> a2 = $a1 split " " This is a test karaf@root()> $a2 2 a karaf@root()> $a2 3 test karaf@root()> each ($a2) {echo $it} This is a test karaf@root()> each ($a1 split " ") {echo $it} This is a test
The following is a shell session for v4.1.5
karaf@root()> a1 = "This is a test" This is a test karaf@root()> $a1 This is a test karaf@root()> a2 = ($a1 split " ") karaf@root()> $a2 0 This karaf@root()> $a2 1 is karaf@root()> $a2 2 a karaf@root()> each ($a1 split " ") {echo $it} usage: each elements { closure } elements: an array to iterate on closure: a function or closure to call karaf@root()> $a2 karaf@root()> each ($a2) {echo $it} usage: each elements { closure } elements: an array to iterate on closure: a function or closure to call
In both versions the split creates an array - but the shell does not seem to be automatically coerce $a2 into an array for v4.1.5
This is breaking several scripts currently.