Hi,

Dan Christopherson wrote:
> On Thu, 9 Nov 2000, Ole Husgaard wrote:
> > "Rickard �berg" wrote:
> > > Are you running the .sh or .bat ones? I have only tested the .bat ones,
> > > which work great for me at least.
> >
> > I am running the .sh scripts, as my OS is too stupid
> > to understand .bat ;-)
> > Or, more precise: I source the script in a sub-shell
> > so I won't have to mark it executable, and so it won't
> > change the environment of my main shell.
> You mean you do:
> bash
> . ./run.sh
> exit
> ??

Almost. I use
[user@host bin]$ (. run.sh)
which means the same thing but is shorter.

> Don't the scripts start with '#!/bin/sh' or the like?
> That starts a subshell to run the script.

To use a script as a binary requires execute access
besides the "#!" preample, and that is not set by default
in jBoss. The script can still be sourced into the current
shell, and in this case the "#!" preample is just another
comment.
Sourcing the script is OK for simple scripts like the
load.sh in jbosstest. But some scripts like run.sh change
environment variables and make your CLASSPATH bigger each
time it is sourced. To avoid these sideeffects I always
use a set of parenthesis when I'm sourcing a script.

This may sound strange, but its a combination of laziness
(not having to type "chmod +x run.sh") and a habit I have
developed (always use a subshell for sourcing to avoid
environment changes).


Best Regards,

Ole Husgaard.

Reply via email to