Running shell scripts with ./ dot-slash [duplicate] Running shell scripts with ./ dot-slash [duplicate] unix unix

Running shell scripts with ./ dot-slash [duplicate]


The null-pointer exceptions are coming from your Java program, so they mean that the process was, in fact, started. They do not, as a rule, indicate a problem with your shell script or its invocation.

. something # this reads the file `something`, running each line as a command            # in your current shell. (Actual behavior is a bit more sophisticated            # than that, but it's close enough)../something # this tries to run the file `something` in the current directory as            # an executable. It doesn't need to be a shell script -- it can be            # any kind of executable, and if it has a shebang line, that will be            # honored to determine the interpreter or shell to use../ something  # <- this is simply invalid.

That said, you can record exactly what commands your script is running by starting it like so:

ksh -x ./something

This will display the commands your script runs. If the fault is caused by the script starting the JVM incorrectly, you can thus determine how the expected and actual invocations differ.


Since you are running in the ksh environment you have another option that using the ./ operator.

Instead of making your script an executable, you can execute it by passing it as an argument to ksh, like so:

ksh yourScript

When you create a file in Unix/Linux, it is not automatically given permission to execute. Therefore, alternatively, you can modify the permissions of your script using chmod:

chmod +x yourScript

You should then be able to execute your script.