Need help in modifying the prompt


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need help in modifying the prompt
# 1  
Old 08-01-2006
Need help in modifying the prompt

Hi,

I want to change the login prompt from $ to something more explanatory like

(Username)(basename of pwd):

I also need to get this in a different font color.

Can someone pls tell me what I have to modify in my rc file. I m using CShell currently.

Would be great if u can give me the generic logic and how to do it in diff shells like Csh, TCsh, Ksh, Bash,sh shells.

Thanks
# 2  
Old 08-01-2006
This command would set the default directory to the current dir.

Place this command in your . profile file.

export PS1=`uname -n`'@$PWD > '

I am not sure of how the text colour can be changed .......
# 3  
Old 08-01-2006
Thanks for the reply.

Would u know what to do for CSH also.

I tried set prompt='${LOGNAME}:${CWD}'

But when I change the directory, the working directory displayed in the prompt does not change.

Also the color. I m very particular abt that Smilie
# 4  
Old 08-01-2006
This has been asked (and answered) before.Here's the link.
# 5  
Old 08-01-2006
Hmm, I cannot see anything mentioned in that link wrt color!
# 6  
Old 08-02-2006
Here's a link to colours in the prompt. Enjoy.
# 7  
Old 08-02-2006
Wow! That was a good site. Thanks.
Would u know some sites for CSh (colors) also. Hope u r not already irritated! Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with modifying a filename

Hello, I have a filename that looks like this: ABC_96_20141031_041133.232468 I need to shorten only the "_2014" part of the filename to simply "_14" so the filename looks like: ABC_96_141031_041133.232468 I have to do a search for this string because there are hundreds of files and... (17 Replies)
Discussion started by: bbbngowc
17 Replies

2. Solaris

Unable to move from rsc prompt to ok prompt

Hi, on sunfire v890 unable to move from rsc prompt to ok prompt, i have executed the command break. (9 Replies)
Discussion started by: manoj.solaris
9 Replies

3. UNIX for Dummies Questions & Answers

How to Change the % prompt to - prompt in UNIX?

how to Change the % prompt to - prompt in unix :wall: ---------- Post updated at 07:40 AM ---------- Previous update was at 07:38 AM ---------- How To display the last modification time of any file in unix ---------- Post updated at 07:40 AM ---------- Previous update was at 07:40 AM... (2 Replies)
Discussion started by: manjiri sawant
2 Replies

4. Shell Programming and Scripting

Modifying the .bashrc

I have modified the .bashrc. The problem is that when I write a long command, it does not write on the next line but continues to write on the same line. # ~/.bashrc: executed by bash(1) for non-login shells. # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) # for... (1 Reply)
Discussion started by: kristinu
1 Replies

5. UNIX for Dummies Questions & Answers

Modifying headers

I have a FASTA file with thousands of sequences that looks something like this: I need to modfy the header in such way that everything after the dot is remove. Thus, I will end up with something like this: Thanks (1 Reply)
Discussion started by: Xterra
1 Replies

6. Shell Programming and Scripting

Modifying a file?

Hi, I want to convert a file that looks like this >joe XXXXXXXXXXXXXXXXXXX >man BBBBBBBBBBBBBBBBBBBBBSSSSSSSS to something that looks like this (where the spacing is tab seperated) joe XXXXXXXXXXXXXXXXXXX man BBBBBBBBBBBBBBBBBBBBBSSSSSSSS I am able to do the reverse but the other... (3 Replies)
Discussion started by: kylle345
3 Replies

7. Shell Programming and Scripting

Modifying a line

Hi, I am having trouble modifying this line. It is because there is a space that I dont know how to deal with. So the file looks like this >YM4911-Contig4 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX >YM4915-Contig5 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMM There are two spaces between contig#... (6 Replies)
Discussion started by: phil_heath
6 Replies

8. UNIX for Dummies Questions & Answers

Modifying rows

Hi, I have a file that looks something like this (2 columns 4 rows): eeeeeeeeeeeeeeeeeeeeeeeeeeeee -45 rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr -24 ttttttttttttttttttttttttttttttttttttttttttt -29 uuuuuuuuuuuuuuuuuuuuuuuuuuu -23 How do I get it to look like this: -45... (3 Replies)
Discussion started by: phil_heath
3 Replies

9. UNIX for Dummies Questions & Answers

Modifying a variable value

Hi all, how do i modify a variable's value. var1='abcd efgh ijkl mnop abcd' how do i get var2 from var1 var2=$(......) $echo var2 abcd efgh ijkl mnop i.e. i have removed a duplicate occurence. or in general how to modify a varible. thanks in advance (6 Replies)
Discussion started by: kartikkumar84@g
6 Replies

10. Shell Programming and Scripting

can someone help me with modifying this file

Hi, I have a file which has data kind of like this. Apr 13 08:20:38 uslis10a sendmail: m3DDKSx3006432: usliss26.ca.com Apr 13 08:20:38 uslis10b sendmail: m3DDKSoK006433: usliss26.ca.com Apr 13 08:20:38 uslis10b sendmail: m3DDKcSo006442: usliss26.ca.com Apr 13 08:20:38 uslis10c... (2 Replies)
Discussion started by: eamani_sun
2 Replies
Login or Register to Ask a Question