LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how do i change the current prompt in shell? (https://www.linuxquestions.org/questions/linux-newbie-8/how-do-i-change-the-current-prompt-in-shell-464556/)

prospekrisal 07-16-2006 09:22 AM

how do i change the current prompt in shell?
 
I just want to change the current frame with my name, what is the code?
e.g.
fahrisal@linux:~> ..code...
prospekrisal:~>

and how to go back to the previous prompt?
e.g.
prospekrisal:~> ..code..
fahrisal@linux:~>

prospekrisal 07-16-2006 09:46 AM

I've just solved the probllem. But now, how to return back?

david_ross 07-16-2006 09:47 AM

To change it just run:
PS1="prospekrisal:~>"

You may want to store your old prompt in a temporary variable - ie:
OLDPS1=$PS1
PS1="prospekrisal:~>"

Then revert with:
PS1=$OLDPS1

You might also want to see:
http://www.linuxquestions.org/questi...d.php?t=115354

prospekrisal 07-16-2006 10:21 AM

Quote:

Originally Posted by david_ross
To change it just run:
PS1="prospekrisal:~>"

how to revert that code?

david_ross 07-16-2006 10:35 AM

Just set PS1 to whatever you want it to be. If you logout and in again it should just go back to the default.


All times are GMT -5. The time now is 05:21 AM.