Create a user defined shell in Ubuntuusing c program
I am using ubuntu flavour of linux operating system i wanted to know how we can create an user defined shell through c program
|
Write one? Why do you want to write a new shell? You're really going need to give more details about what you want to do.
|
i am givin the following c code so that the $ prompt which comes default gets changed but my code is not working
#include<stdlib.h> int main() { while(1) { system("PS1=\"FTS>\" bash" ); } return 0; } i want FTS> to come instead of the $ prompt |
Why on Earth are you trying to write a C program for this? There's no need to write a program just to change your prompt. This has nothing to do with creating a new shell.
You just set the PS1 variable and it will change the prompt for your current shell. If you want a permanent change, then put it in your ~/.bashrc. |
i want to implement more things in that code thats why i want to write c program on that,
can u please help me out with it..... |
What exactly do you want to do? If you want to create a new shell, then look at the source code for Bash, Tcsh, or any other shell.
|
can u please tell me how to create a new user defined shell in c program..
|
Please write words out in full.
|
sir im extremly new to this os i have very limited information regarding all this commands if u can help then it would be really great.
|
You still haven't explained exactly what you want to do. Why do you want to create a new shell? I suspect that's not what you want to do, but you're not exactly helping us to understand what it is you want.
Please write words out in full and use punctuation, because it's difficult to read posts without it. |
OK,
Sir let me start from the beginning, i want to create my own shell in which i can execute my own user defined commands. since I'm new to this OS i don't have enough knowledge of the terminology used here. |
What exactly do you mean by "user defined commands"? Are they just programs you've written? Why do you need a new shell for that? Again, you should probably look at how, e.g. Bash works..
|
user defined command means fr eg: for ls command i want to give myls which will work like "ls" but in my own shell which i have created.
i want to do this so as to learn creation of shell and want to create my own commands. |
Hello parmishr and Welcome to LinuxQuestions,
I'm under the same impression as Nylex that you are complicating things way to much. Why would you reinvent the wheel? If it's only for learning purposes, great! But if you want to learn from scratch on how to 'create' your own shell, why don't you, as already told by Nylex, download the source of one of the shells available, for example Bash, investigate that source code, adapt it to your needs and compile. Then you would have 'your own commands' in a shell. Another way to have your 'user-defined commands' is to work with aliases. @Nylex: if the cake means what I think it means... Happy Birthday! Kind regards, Eric |
ok i will do that also i mentioned one code above can you just correct it so that i can get the FTS> prompt.
that will be a big help regards |
All times are GMT -5. The time now is 03:34 PM. |