LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to set PS2 , PS3 and PS4 variable. (http://www.linuxquestions.org/questions/linux-software-2/how-to-set-ps2-ps3-and-ps4-variable-740485/)

linuxjamil 07-16-2009 04:58 AM

How to set PS2 , PS3 and PS4 variable.
 
Dear All

This is very long since that I cannot solve the problem of PS1, PS2 , PS3 variable. My problem is I cannot set PS2 , PS3 , PS4 variable in linux and as well now in Solaris 10..

Would you please tell how to set these variables and what is the definition of these variables in Linux ?

Please respond.

xeleema 07-16-2009 05:59 AM

It's Nothing but a Shell Thing
 
Greetingz!

For starters, the PS1, PS2, PS3 and PS4 variables are a "shell" thing, not necessarily a Linux thing.

Depending on the shell you're using, you may have all four (like with bash), on only two (like the regular bourne shell "sh").

To set one of them in most shells, just type the following;
$ export PS2=" > "
From the bash 3.2.25 man page;
PS1 The value of this parameter is expanded (see PROMPTING below) and used as the primary prompt string. The default value is "\s-\v\$".

PS2 The value of this parameter is expanded as with PS1 and used as the secondary prompt string. The default is "> ".

PS3 The value of this parameter is used as the prompt for the select command (see SHELL GRAMMAR above).

PS4 The value of this parameter is expanded as with PS1 and the value is printed before each command bash displays during an execution trace. The first character of PS4 is replicated multiple times, as necessary, to indicate multiple levels of indirection. The default is "+ ".
If you find this helpful, click the "thumbs-up" on this post.
Also, if this post answers your question, feel free to mark this thread as "Solved".

Have a good one!

barunparichha 07-16-2009 06:52 AM

U can also put exert PS1=">" in some startup script like .bashrc, to make this permanent.

barunparichha 07-16-2009 07:44 AM

In Solaris 10:

$echo $PS1
${CUE_HOSTNAME}:"$PWD" \! $

$export PS1="${CUE_HOSTNAME}:"$PWD" \! >"

This changes my $ to >.

AlucardZero 07-16-2009 09:26 AM

Quote:

Originally Posted by barunparichha (Post 3609423)
U can also put exert PS1=">" in some startup script like .bashrc, to make this permanent.


"export" not "exert". Please take the time to use proper English, for the sake of accuracy and of those who don't speak English as a first language.


All times are GMT -5. The time now is 03:02 PM.