You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "Saikat Ghosh (JIRA)" <ji...@apache.org> on 2018/02/19 02:25:00 UTC
[jira] [Created] (KARAF-5613) Scripting Behaviour changed from
Karaf 4.0.9 to 4.1.5
Saikat Ghosh created KARAF-5613:
-----------------------------------
Summary: Scripting Behaviour changed from Karaf 4.0.9 to 4.1.5
Key: KARAF-5613
URL: https://issues.apache.org/jira/browse/KARAF-5613
Project: Karaf
Issue Type: Bug
Components: karaf-shell
Affects Versions: 4.1.5
Reporter: Saikat Ghosh
Scripting behavior has changed between Karaf v4.0.9 and v4.1.5
*The following is a shell session for v4.0.10*
{noformat}
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{noformat}
*The following is a shell session for v4.1.5*
{noformat}
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{noformat}
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.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)