Changing your csh prompt

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 Set your csh prompt promptly sidebar. You can change this prompt using the following steps. You start by finding your prompt statement (Code Listing 8.16), then modify it in your editor (Figure 8.6).

To change your csh prompt:

1.
grep path ~/.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.16.

The Setting your csh prompt promptly sidebar will help you translate this code.

Code Listing 8.17. Test out your new prompt to see if you like it.
xmission> su - ejray
Password:
Sun Microsystems Inc.  SunOS 5.5.1   Generic 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>

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.6.

Figure 8.6. Edit your prompt to include the details you want.


4.
Save the file and exit from the editor.

5.
su - yourid

Log in again to try it out (Code Listing 8.17).

Note

Note the trailing space in the prompt code: set prompt="$LOGNAME > ". This extra space makes the prompt easier to use.


Setting your csh prompt promptly

You can set your csh prompt to contain some types of information, but not as many as the bash or ksh prompts. The following list shows you what code to use to add certain kinds of information to your prompt (as well as helping you translate the code in your existing prompt):

  • $LOGNAME shows the userid of the current user—that's you.

  • ${cwd} shows the current working directory with a path.

  • 'uname -n'% shows the hostname of the computer.

Or, use any other environment variables of your choice.


Code Listing 8.18. Type alias at the shell prompt to see a list of aliases you've set.
xmission> alias
cd      cd !*;echo $cwd
clr     clear
cls     clear
copy    cp -i
del     rm -i
delete  rm -i
dir     ls -alg
home    cd ~
ls      ls -F
md      mkdir
move    mv -i
pwd     echo $cwd
type    more
xmission>

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.213.238