shell how to? [Archive] - C Board

PDA

View Full Version : shell how to?


Unregistered
08-21-2002, 12:26 AM
i want to write like a little simple shell prog... but i cant seem to get this part to work all the timez

[guess@shellerz ]$ <---- i want that to keep going.. like if i was to enter "ls" then i want it to stay as [guess@shellerz ]$ and not to change back to my regular shell... can anyone please tell me how i can start this..? thanx....

shaik786
08-21-2002, 05:56 AM
Which shell are you using? If it is bash, do:
export PS1="[guess@shellerz ]$ "
In csh, you can do:
set prompt="[guess@shellerz ]$ "

Troll_King
08-21-2002, 07:15 AM
Write the script in an editor like emacs:

emacs myscript

Than start the script with the text:
#!/bin/bash

Unregistered
08-21-2002, 10:51 AM
ya but i want to creat it in c..... cause i wanted to creat other thingz in there... like a colored shell or an animated text... but i need to know how to code the shell first..

starX
08-22-2002, 08:34 AM
Eeek. Bash will do shell colours. What kind of text animation are you talking about? I'm thinking it would probably be easier to learn how to do this in Basdh (or any other pre-existing shell for that matter) than trying to code your own shell. If convenience is what you want, I tend to think it would be more convenient for you to learn what's there.

starX
www.axisoftime.com