views:

47

answers:

1

I'm working on a project where I'd like users to experiment with Java classes on Groovysh. I'd like to make it convenient for them and want to import certain packages by default, when groovysh starts up so that users would not have to re-type the same imports every time they start the shell. Does anyone know how to accomplish this?

Thanks in advance, igor

+1  A: 

You can add the imports to $HOME/.groovy/groovysh.rc

Matthew Flaschen
Matthew, thanks, this works, but it requires some configuration on the client box. A more convenient way for me would be a command line option to tell groovysh to load a groovy file. Is this possible? This seems a simple task, but I can't see this in documentation.thanks,igor
ipolevoy
Could you change the script to add the relevant configuration to `groovysh.rc` if it doesn't already exist?
Don
hm, this is an idea, but where can I configure to run a script other than the groovysh.rc?
ipolevoy