shell specific prompt


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers shell specific prompt
# 1  
Old 04-26-2005
shell specific prompt

currently, I set my prompt in my .cshrc file as:
set prompt = "%B%h %m %P %/ \n% "

I have to use certain shells for some specific tasks and would like to set different prompts depending on the type of shell that I am using. Any advice?

Thanks
# 2  
Old 04-26-2005
Just have a if/then/else or case statement on the $SHELL variable. Then you can set your PS1 value accordingly.

Cheers,

Keith
# 3  
Old 04-26-2005
When I launch a new shell from the command line, the value of my $SHELL variable does not change so I am not able to do an if statement on it.
# 4  
Old 04-27-2005
the only way i know to set this up is to set the prompt for each shell using the specific shell's initialization files --- .login & .cshrc for csh, .profile and .kshrc for ksh, .bashrc for bash, etc. ...
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash function to suppress warning message for specific text and display prompt

In the below bash function multiple variants are input and stored in a variable $variant, and each is written to an out file at c:/Users/cmccabe/Desktop/Python27/out.txt stored on a separate line. # enter variant phox2b() { printf "\n\n" printf "What is the id of the patient getting... (0 Replies)
Discussion started by: cmccabe
0 Replies

2. AIX

Shell Scripting (prompt off)

Dear all experts, I have a script written to compress a list of files, during compressing, some of the files are having same name. When the compressing started, the same name file will be prompted with message whether to overwrite the old file. I need to enter "y" to continue. Is there any way I... (7 Replies)
Discussion started by: kwliew999
7 Replies

3. Shell Programming and Scripting

Shell Script to prompt customer for name etc

How do I create a shell script called 'custinfo' to prompt a customer to enter and display back the following: name, age, address, phone number, product, price range. Thanks (1 Reply)
Discussion started by: SQLScript
1 Replies

4. Shell Programming and Scripting

Changing the shell prompt

Hi, I want to change the shell prompt, using the cd command. I have a shell prompt like this - p78-mfx(dgaw1078/9781)$ Now i do this - p78-mfx(dgaw1078/9781)$ cd log4j here the shell prompt should change like this - p78-mfx(dgaw1078/9781)log4j$ (6 Replies)
Discussion started by: arunkumarmc
6 Replies

5. UNIX for Dummies Questions & Answers

how much we can pipe in shell prompt ?

Hi All experts, I was asked some questions of late & i was not aware of these. 1Q. how much we can pipe in shell prompt ?2Q. how many arguments we can pass in shell script & how to print that ? (eg, if i want to know what I passed in 11th Argument) ( for 3rd argument we can do echo $3, but I think... (7 Replies)
Discussion started by: adc22
7 Replies

6. Shell Programming and Scripting

Print a message at specific line on prompt

Hi Friends, I am using HP-UNIX(ksh). I want to print a message at specific line on the prompt screen. For Example: for num in 1 10 3 145 do echo $num // need to print this on the same line for each number sleep 2 done Actual Output: ========== 1 10 3 145 Expected Output:... (5 Replies)
Discussion started by: Niroj
5 Replies

7. UNIX for Advanced & Expert Users

Weird in Shell Prompt

Hi, I saw something in weird in Shell prompt. I did the following steps 1) Typed ls -l and pressed ESC without entering 2) Typed "v" (please notice that I did not type "i" after "v"), which opened vi editor 3) I see the "ls -l" command that I typed in shell prompt 4) Without modifying... (6 Replies)
Discussion started by: bobbygsk
6 Replies

8. Shell Programming and Scripting

script to change shell and prompt

I want to write a shell script which will change the current shell (say from csh to bsh) and my Prompt (say my name) as desired.pls help (1 Reply)
Discussion started by: SHYAM
1 Replies

9. UNIX for Dummies Questions & Answers

prompt in sh shell

Hi, I´m using SCO Unix 5.0.5 and I want to configure de variable PS1, so when I type the command: cd /etc/ the prompt shows /etc/_> Is that possible with sh shell? I´ll appreciate your help. Thanks, a Happy New Year! (1 Reply)
Discussion started by: diegoe
1 Replies

10. UNIX for Dummies Questions & Answers

No shell prompt?

When I login to a specific machine (running Solaris 2.8; actually serveral machines behave this way), with a known good account, I don't get any shell prompt, and no screen responses to various commands such as ID and PWD. Any ideas on what is causing this, and how to change this behavior? (2 Replies)
Discussion started by: Mufasa
2 Replies
Login or Register to Ask a Question