karaf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From J. Brebec <jeremie.bre...@gmail.com>
Subject Re: Shell & Quote
Date Tue, 21 Jul 2020 13:24:02 GMT
A simple example with camel and Karaf 4.2.9:

karaf@root()> camel:component-list "a'b"
Error executing command: unexpected EOT looking for matching quote: '
karaf@root()> camel:component-list "a\'b"
Camel context a\'b not found.

Without a quote "a'b" is invalid.
With a backslash, "a\'b" is valid, however, the command "sees" the backslash (and I don't
think every command should handle quoting in an argument?)

If I use a native gogo(jline?) command, it's working:

karaf@root()> echo "a\'b"
a'b





On 2020/07/21 12:13:42, Jean-Baptiste Onofre <jb@nanthrax.net> wrote: 
> Hi,
> 
> Assuming the last argument is String, did you try " and \" ?
> 
> I just try and it works fine for me (on Linux and Mac).
> 
> Can you provide some environment details to me please ?
> 
> Thanks !
> Regards
> JB
> 
> > Le 21 juil. 2020 à 10:08, J. Brebec <jeremie.brebec@gmail.com> a écrit :
> > 
> > Hello,
> > 
> > I have a Karaf shell command which take a String parameters.
> > How can I call it with a parameters with space and quote ?
> > 
> > this doesn't work (the command is not executed with a error about a non-matched
quote)
> > ns:mycmd "xx n'est pas conforme"
> > 
> > this doesn't work either: the command is executed, but the backlash is seen by my
command
> > ns:mycmd "xx n\'est pas conforme"
> > 
> > I didn't found the right syntax..
> > 
> > thanks!
> > 
> > Jérémie
> > 
> 
> 

Mime
View raw message