: How to write our own shell that accepts only 3 commands. : basicly a shell under linux is a program that is started after you login. You can change it in /etc/passwd for one or more users. For example, terminals - machines that are prepared for on specific program (for example in stores) replace the default shell by their program so when a user logins, he will be only able to use that program.
So if you want to write a shell which accepts 3 commands, write a simple program with a gets in loop, test the input, execute actions associated with them. Simple
Oh, and don't do something stupid like replacing shells of all users by yours, if you do that, you want be able to access the bash anymore You will need to edit passwd from an other linux
Comments
:
basicly a shell under linux is a program that is started after you login.
You can change it in /etc/passwd for one or more users.
For example, terminals - machines that are prepared for on specific program (for example in stores) replace the default shell by their program so when a user logins, he will be only able to use that program.
So if you want to write a shell which accepts 3 commands, write a simple program with a gets in loop, test the input, execute actions associated with them. Simple
Oh, and don't do something stupid like replacing shells of all users by yours, if you do that, you want be able to access the bash anymore