You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by ken <an...@gmail.com> on 2013/11/05 01:21:37 UTC

shell scripting

Hi,

the shell-init-script allows one to define additional commands, i have a few
questions regarding this.

1.  can there be multiple copy of this file?  lets say i have a complex
script and i like it to reside in its own file for clarity.  now i would
have shell-init-command and foobar-command, etc...

2.  the script is ran each time a shell is created, would it be possible to
add create/add/delete commands via java api?

Also, is there an ability to write a bunch of commands in a text file and
have the karaf console execute those commands in the file?  for example, a
text file will contain the following entries
bundle:install foobar
bundle:start foobar
foobar:foo args

because i may need to run this across a few instances, it would be nice not
having to type or copy & paste this many times.

Thanks,

Ken



--
View this message in context: http://karaf.922171.n3.nabble.com/shell-scripting-tp4030203.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: shell scripting

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Ken,

You have only one shell.init.script, but you can define "complex" 
aliases that run script and define other aliases, for instance:

my-aliases = {

   foo:foo = { bar:bar $args };
   ...

}

Using client you can also execute a script directly in Karaf.

Regards
JB

On 11/05/2013 01:21 AM, ken wrote:
> Hi,
>
> the shell-init-script allows one to define additional commands, i have a few
> questions regarding this.
>
> 1.  can there be multiple copy of this file?  lets say i have a complex
> script and i like it to reside in its own file for clarity.  now i would
> have shell-init-command and foobar-command, etc...
>
> 2.  the script is ran each time a shell is created, would it be possible to
> add create/add/delete commands via java api?
>
> Also, is there an ability to write a bunch of commands in a text file and
> have the karaf console execute those commands in the file?  for example, a
> text file will contain the following entries
> bundle:install foobar
> bundle:start foobar
> foobar:foo args
>
> because i may need to run this across a few instances, it would be nice not
> having to type or copy & paste this many times.
>
> Thanks,
>
> Ken
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/shell-scripting-tp4030203.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com