On Sun, Nov 7, 2010 at 7:13 PM, Linux "Kernel" Explorer <mylinuxlab@xxxxxxxxx> wrote:
These questions are not directly related to Linux kernel, I would however recommend you to READ MORE before you ask.
Maurice J Bach has good description about how shell works, and there are couple of other books on operating system which will describe the details of shell.
Hi,
Lately I have been trying my hand at Linux Shell scripting.
I understand that "SHELL" is a layer between the operating system & Enduser and you can unleash its power to have a better control over your system.
Not necessarily, but yes shell is an important use space application.
unleash, LOL!
unleash, LOL!
However, I dont have clarity with respect to the following questions :
- Do Endusers always interact with the operating system through a SHELL even if they are using a GUI : I presume "YES"
NOPES, not necessarily. all you need to interact with kernel is system calls. A lot of program uses it
besides, if all the program run on top of shell, they will be very slow.
A fair number of process could be own by tty, but that is not shell in strict sense, its just a device
besides, if all the program run on top of shell, they will be very slow.
A fair number of process could be own by tty, but that is not shell in strict sense, its just a device
- Why exactly do we need SHELL ?
its an interface as you pointed out, as soon as you login, the tty process spawns a shell(CMIIW)
- Shell scripts are light weight programs but cant we do away with them and substitute them regular programs in C
Nopes, shell script perform things without compilation, they run a sequence of command specific to that particular shell.
- System calls / APIs - do they also invoke shell or do they bypass it.
that depends on where the program is being called from in most cases it is called by shell. so technically shell owns most program, but they can detach themselves from shell as they can daemonize(CMIIW)
- If Shell is so important then why there isnt too much of focus on it.
LOL, that is not correct. Shell is full developed and it does whatever is required pretty well.
The default shell which is BASH in most cases still undergoes development and bug fixes etc.
The default shell which is BASH in most cases still undergoes development and bug fixes etc.
- Environment variables - are they specifically defined so that they can be used by "Shell Scripts"
Any process running on that particular shell can utilize the variable set using either a command or script irrespective of who specified them as long as the session and owners are same
Regards,
These questions are not directly related to Linux kernel, I would however recommend you to READ MORE before you ask.
Maurice J Bach has good description about how shell works, and there are couple of other books on operating system which will describe the details of shell.