Quote:
Originally Posted by shravee
so can i take it granted that bash in general is used to create a new child shell under the same id.
|
That's not wrong but it is not the simplest and most comprehensive way of describing what happens when you run a command at the command prompt and what bash is.
When you enter a
bash at the command prompt and press enter your current
shell finds what bash is (you can do the same thing in a bash shell with
type bash). In this case it finds it is /bin/bash. Your current shell then forks (produces an identical copy of itself with the single difference that the return code from fork lets the child process know it is the child). This being an identical process it is running as the same user (when you write id, I think you mean user). The child process, still running the same shell as your current shell, then calls exec which loads /bin/bash into the process (replacing your current shell in the child process with /bin/bash) and starts running it.
What bash does is described
here. From your point of view the most important thing it does is (almost certainly) configure itself from ~/.bashrc and it is this file (or maybe another file that it references) that sets $PATH to a list which includes the jar program's directory.
There's no need to run bash to be able to run jar. You could configure your current shell's $PATH to include the jar program's directory. How to do that is dependent of which of several possible shells you are using. It is probably the one listed for your user in /etc/passwd.
Did you use pstree to see the relationship between your current shell and the bash shell you started from it?