Your system’s default prompt might be just a dollar sign ($) or perhaps a dollar sign and date, or other information as outlined in the Setting Your csh Prompt Promptly sidebar. You can change this prompt using the following steps. You start by finding your prompt statement (Code Listing 8.21), then modifying it in your editor (Figure 8.7).
1. | grep prompt ~/.cshrc ~/.login To begin, list the configuration files located in your home directory and in the /etc directory. Look through your system configuration files for your prompt statement. It’ll look something like set prompt=”> “ or set prompt=”’hostname’> “. It’s likely in your .cshrc file, as shown in Code Listing 8.21. The Setting Your csh Prompt Promptly sidebar will help you translate this code. | |
2. | vi .cshrc Use the editor of your choice to edit the configuration file with the prompt setting in it. | |
3. | set prompt="$LOGNAME > " Set your prompt to something more suitable, as shown in Figure 8.7. Code Listing 8.21. The prompt statement will likely be in your .cshrc file.
| |
4. | Save the file and exit from the editor. | |
5. |
✓ Tip
Note the trailing space in the prompt code: set prompt=”$LOGNAME > “. This extra space makes the prompt easier to use.
Setting Your csh Prompt PromptlyYou can set your csh prompt to contain some types of information, but not as many as the bash or zsh prompts. The following list shows you what code to use to add certain kinds of information to your prompt (as well as help you translate the code in your existing prompt):
|
xmission> su - ejray Password: Sun Microsystems Inc. SunOS 5.5.1Generic May 1996 You have mail. NOTE! As of 7/15/98, "tin" has been backed out its prior version. NNTP support was compiled in directly as well. We hope that this will stabilize its problems. ___________________________________________________________________ General questions email to "help" or "[email protected]". Problems with the system mail to "support" or "[email protected]". Type "acctstat" for a summary of your current account information. Type "quota -v" to view your existing disk quota. Type "help" for a list of online programs or "menu" for the assisted menu. ejray> |