As JB mentioned, Karaf has a script that where commands can be put, which is:
etc/shell.init.script Try setting up an alias in there to a command, such as to run a script which can have all the commands in it that you want to run: shell:source [options] script [args] Ryan On Mon, Dec 2, 2013 at 8:20 AM, Patryk Kucharz <[email protected]> wrote: > Hi Jean, > > Thank you for your answer. I think your solution will be very useful. > > But is it possible to call from my command already implemented functions > or scripts? > Maybe I can use my command to call shell:source. Generally, my intention > is to try do some things automatically. For instance, when bundle won't > install successfully I would like Karaf to try repeat whole procedure again > automatically or react in some other way. > > Regards, > PK > > > 2013/12/2 Jean-Baptiste Onofré <[email protected]> > >> Hi Patryk, >> >> Why not directly creating an alias in etc/shell.init.script that perform >> these actions ? >> >> You script can be called with shell:source command too. >> >> Regards >> JB >> >> >> On 12/02/2013 12:50 PM, Patryk Kucharz wrote: >> >>> Hello, >>> >>> I am trying to add some new commands to karaf console. I have read that >>> tutorial: >>> http://karaf.apache.org/manual/latest-2.2.x/developers-guide/extending- >>> console.html >>> >>> I am wondering if there is any possibility to call from my new command >>> the one of those already implemented commands? >>> >>> For instance, I would like to implement command which will add feature, >>> install it and then show the list of already installed features. That is >>> why I need to call features:addurl, features:install, features:list etc. >>> >>> I appreciate any help from your side. >>> >>> Regards, >>> PK >>> >> >> -- >> Jean-Baptiste Onofré >> [email protected] >> http://blog.nanthrax.net >> Talend - http://www.talend.com >> > >
