Customize tcsh Prompt

I've read the manual and used search engines but haven't been able to find a solution. All I want to do is change the user prompt from a % to a $. When I set it via PROMPTCHARS="$#" all I get is a 0. I even tried single quotes and using "%{$%}". There aren't any prompt settings in the other .conf or.*rc files. Thanks for any help.
 
If I'm not mistaken it's promptchars, in lower case. Exactly what is the command you are you currently using to set your prompt?
 
Since "$#" has special meaning in the shell (i.e., number of arguments), perhaps you need to use single quotes instead of double quotes? If using double quotes, I think you would have to escape the '$' as in "\$#". Disclaimer: I don't have a way to test this and have not used tcsh(1) in a long, long while.
 
fonz said:
If I'm not mistaken it's promptchars, in lower case. Exactly what is the command you are you currently using to set your prompt?
It is lower case; I don't know why I capitalized in my original post. :)
 
trh411 said:
Since "$#" has special meaning in the shell (i.e., number of arguments), perhaps you need to use single quotes instead of double quotes? If using double quotes, I think you would have to escape the '$' as in "\$#". Disclaimer: I don't have a way to test this and have not used tcsh(1) in a long, long while.

I just slapped my forehead for not thinking of escaping. Just tried it and it didn't work, I just get a '\'. I'm going to try single quotes again.
 
Hmmm. I must've had formatting wrong on another computer - the one I was using all day - because the single quotes, without escaping, works on this one. Thanks @trh411.
 
Last edited by a moderator:
Back
Top