You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Andreas Sewe <an...@codetrails.com> on 2016/09/07 08:56:31 UTC

Gogo shell: eval $cmdline

Hi,

I am currently struggling with the eval command for the Gogo shell.
Unfortunately, I wasn't able to dig up any documentation on it. Not even
"help eval" returns something (probably, because eval is not a "real"
command).

What I want is essentially the following:

> cmdline = [ "command" "arg1" "arg2" ]
> eval $cmdline

Is this possible somehow?

Best wishes,

Andreas

-- 
Codetrails GmbH
The knowledge transfer company

Robert-Bosch-Str. 7, 64293 Darmstadt
Phone: +49-6151-276-7092
Mobile: +49-170-811-3791
http://www.codetrails.com/

Managing Director: Dr. Marcel Bruch
Handelsregister: Darmstadt HRB 91940

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Gogo shell: eval $cmdline

Posted by Guillaume Nodet <gn...@apache.org>.
Try
> eval "$cmdline"

Cheers,
Guillaume


2016-09-07 10:56 GMT+02:00 Andreas Sewe <an...@codetrails.com>:

> Hi,
>
> I am currently struggling with the eval command for the Gogo shell.
> Unfortunately, I wasn't able to dig up any documentation on it. Not even
> "help eval" returns something (probably, because eval is not a "real"
> command).
>
> What I want is essentially the following:
>
> > cmdline = [ "command" "arg1" "arg2" ]
> > eval $cmdline
>
> Is this possible somehow?
>
> Best wishes,
>
> Andreas
>
> --
> Codetrails GmbH
> The knowledge transfer company
>
> Robert-Bosch-Str. 7, 64293 Darmstadt
> Phone: +49-6151-276-7092
> Mobile: +49-170-811-3791
> http://www.codetrails.com/
>
> Managing Director: Dr. Marcel Bruch
> Handelsregister: Darmstadt HRB 91940
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>


-- 
------------------------
Guillaume Nodet
------------------------
Red Hat, Open Source Integration

Email: gnodet@redhat.com
Web: http://fusesource.com
Blog: http://gnodet.blogspot.com/

Re: Gogo shell: eval $cmdline

Posted by Andreas Sewe <an...@codetrails.com>.
Hi,

> eval takes a string argument, not an array:

thank you, that did the trick!

Andreas

-- 
Codetrails GmbH
The knowledge transfer company

Robert-Bosch-Str. 7, 64293 Darmstadt
Phone: +49-6151-276-7092
Mobile: +49-170-811-3791
http://www.codetrails.com/

Managing Director: Dr. Marcel Bruch
Handelsregister: Darmstadt HRB 91940

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Gogo shell: eval $cmdline

Posted by Guillaume Nodet <gn...@apache.org>.
With proper formatting...

Using org.apache.felix.gogo.runtime-0.17.0-SNAPSHOT.jar, I have the
following:


java -cp ../../jline3/target/jline-3.0.0-SNAPSHOT.jar:runtime/target/
org.apache.felix.gogo.runtime-0.17.0-SNAPSHOT.jar:jline/
target/org.apache.felix.gogo.jline-0.1.0-SNAPSHOT.jar
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
org.apache.felix.gogo.jline.Main

g! cmd = 'echo foo'

g! eval $cmd

foo

g! cmdv = [echo foo]

g! eval "$cmdv"

foo


Which seems more intuitive to me, as "$x" should be different from $x, and
the quotes clearly means you want a string.

2016-09-07 11:17 GMT+02:00 Derek Baum <de...@baums.org.uk>:

> eval takes a string argument, not an array:
>
>
> g! cmd = 'lb -s system'
> lb -s system
>
> g! eval $cmd
> START LEVEL 1
>    ID|State      |Level|Symbolic name
>     0|Active     |    0|org.apache.felix.framework (5.4.0)|5.4.0
>
>
> if you really have the command in an array:
>
> g! cmdv = [lb -s system]
> lb
> -s
> system
>
> g! eval "$cmdv"
> lb,
> -s,
> system
>
> you need to convert it to a string first:
>
>
> g! stringclass = ((bundle 0) loadclass java.lang.String)
>
> g! cmds = ($stringclass join " " $cmdv)
> lb -s system
>
> g! eval $cmds
> START LEVEL 1
>    ID|State      |Level|Symbolic name
>     0|Active     |    0|org.apache.felix.framework (5.4.0)|5.4.0
> g!
>
>
> —
> Derek
>
>
> > On 7 Sep 2016, at 09:56, Andreas Sewe <an...@codetrails.com>
> wrote:
> >
> > Hi,
> >
> > I am currently struggling with the eval command for the Gogo shell.
> > Unfortunately, I wasn't able to dig up any documentation on it. Not even
> > "help eval" returns something (probably, because eval is not a "real"
> > command).
> >
> > What I want is essentially the following:
> >
> >> cmdline = [ "command" "arg1" "arg2" ]
> >> eval $cmdline
> >
> > Is this possible somehow?
> >
> > Best wishes,
> >
> > Andreas
> >
> > --
> > Codetrails GmbH
> > The knowledge transfer company
> >
> > Robert-Bosch-Str. 7, 64293 Darmstadt
> > Phone: +49-6151-276-7092
> > Mobile: +49-170-811-3791
> > http://www.codetrails.com/
> >
> > Managing Director: Dr. Marcel Bruch
> > Handelsregister: Darmstadt HRB 91940
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> > For additional commands, e-mail: users-help@felix.apache.org
> >
>
>


-- 
------------------------
Guillaume Nodet
------------------------
Red Hat, Open Source Integration

Email: gnodet@redhat.com
Web: http://fusesource.com
Blog: http://gnodet.blogspot.com/

Re: Gogo shell: eval $cmdline

Posted by Guillaume Nodet <gn...@apache.org>.
Using org.apache.felix.gogo.runtime-0.17.0-SNAPSHOT.jar, I have the
following:


java -cp
../../jline3/target/jline-3.0.0-SNAPSHOT.jar:runtime/target/org.apache.felix.gogo.runtime-0.17.0-SNAPSHOT.jar:jline/target/org.apache.felix.gogo.jline-0.1.0-SNAPSHOT.jar
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
org.apache.felix.gogo.jline.Main

g! cmd = 'echo foo'

                           g! eval $cmd

                                                      foo

g! cmdv = [echo foo]

                            g! eval "$cmdv"

                                                       foo


Which seems more intuitive to me, as "$x" should be different from $x, and
the quotes clearly means you want a string.


2016-09-07 11:17 GMT+02:00 Derek Baum <de...@baums.org.uk>:

> eval takes a string argument, not an array:
>
>
> g! cmd = 'lb -s system'
> lb -s system
>
> g! eval $cmd
> START LEVEL 1
>    ID|State      |Level|Symbolic name
>     0|Active     |    0|org.apache.felix.framework (5.4.0)|5.4.0
>
>
> if you really have the command in an array:
>
> g! cmdv = [lb -s system]
> lb
> -s
> system
>
> g! eval "$cmdv"
> lb,
> -s,
> system
>
> you need to convert it to a string first:
>
>
> g! stringclass = ((bundle 0) loadclass java.lang.String)
>
> g! cmds = ($stringclass join " " $cmdv)
> lb -s system
>
> g! eval $cmds
> START LEVEL 1
>    ID|State      |Level|Symbolic name
>     0|Active     |    0|org.apache.felix.framework (5.4.0)|5.4.0
> g!
>
>
> —
> Derek
>
>
> > On 7 Sep 2016, at 09:56, Andreas Sewe <an...@codetrails.com>
> wrote:
> >
> > Hi,
> >
> > I am currently struggling with the eval command for the Gogo shell.
> > Unfortunately, I wasn't able to dig up any documentation on it. Not even
> > "help eval" returns something (probably, because eval is not a "real"
> > command).
> >
> > What I want is essentially the following:
> >
> >> cmdline = [ "command" "arg1" "arg2" ]
> >> eval $cmdline
> >
> > Is this possible somehow?
> >
> > Best wishes,
> >
> > Andreas
> >
> > --
> > Codetrails GmbH
> > The knowledge transfer company
> >
> > Robert-Bosch-Str. 7, 64293 Darmstadt
> > Phone: +49-6151-276-7092
> > Mobile: +49-170-811-3791
> > http://www.codetrails.com/
> >
> > Managing Director: Dr. Marcel Bruch
> > Handelsregister: Darmstadt HRB 91940
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> > For additional commands, e-mail: users-help@felix.apache.org
> >
>
>


-- 
------------------------
Guillaume Nodet
------------------------
Red Hat, Open Source Integration

Email: gnodet@redhat.com
Web: http://fusesource.com
Blog: http://gnodet.blogspot.com/

Re: Gogo shell: eval $cmdline

Posted by Derek Baum <de...@baums.org.uk>.
eval takes a string argument, not an array:


g! cmd = 'lb -s system'
lb -s system

g! eval $cmd
START LEVEL 1
   ID|State      |Level|Symbolic name
    0|Active     |    0|org.apache.felix.framework (5.4.0)|5.4.0


if you really have the command in an array:

g! cmdv = [lb -s system]
lb
-s
system

g! eval "$cmdv"
lb,
-s,
system

you need to convert it to a string first:


g! stringclass = ((bundle 0) loadclass java.lang.String)

g! cmds = ($stringclass join " " $cmdv)
lb -s system

g! eval $cmds
START LEVEL 1
   ID|State      |Level|Symbolic name
    0|Active     |    0|org.apache.felix.framework (5.4.0)|5.4.0
g!


—
Derek


> On 7 Sep 2016, at 09:56, Andreas Sewe <an...@codetrails.com> wrote:
> 
> Hi,
> 
> I am currently struggling with the eval command for the Gogo shell.
> Unfortunately, I wasn't able to dig up any documentation on it. Not even
> "help eval" returns something (probably, because eval is not a "real"
> command).
> 
> What I want is essentially the following:
> 
>> cmdline = [ "command" "arg1" "arg2" ]
>> eval $cmdline
> 
> Is this possible somehow?
> 
> Best wishes,
> 
> Andreas
> 
> -- 
> Codetrails GmbH
> The knowledge transfer company
> 
> Robert-Bosch-Str. 7, 64293 Darmstadt
> Phone: +49-6151-276-7092
> Mobile: +49-170-811-3791
> http://www.codetrails.com/
> 
> Managing Director: Dr. Marcel Bruch
> Handelsregister: Darmstadt HRB 91940
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>