OpenWindows Advanced User's Guide

10.2.4 Changing Your Command Prompt

The syntax you use to change your command prompt depends on whether you are using the Bourne, Korn or C shell.

10.2.4.1 Bourne and Korn Shells

For the Bourne or Korn shells, you redefine your command prompt with the PS1 command. The following are three examples:

PS1=": "
PS1="`hostname`: "
PS1="`hostname`{`id`}}: "

Type any of the examples above to change your current command prompt. The prompt will remain until you change it again, or logout.

If you want to make your changes more permanent, add one of the above examples (or a prompt of your own creation) to your .profile file. If you do this, the prompt you specify will appear each time you login in or start a new shell.

10.2.4.2 C Shell

For the C shell, you personalize your command prompt with the set prompt command. The following are three examples:

set prompt="% "
set prompt="`hostname`\!: "
set prompt="`hostname`{`id`}}: "

Type any of the examples above to change your current command prompt. The prompt will remain until you change it again, or logout.

If you want to make your changes more permanent, add one of the above examples (or a prompt of your own creation) to your .cshrc file. If you do this, the prompt you specify will appear each time you login in or start a new shell.