Полезная информация

UNIX Power Tools

UNIX Power ToolsSearch this book
Previous: 7.6 Session Information in Your Terminal's Status Line Chapter 7
Setting Your Shell Prompt
Next: 7.8 Highlighting in Shell Prompts
 

7.7 A "Menu Prompt" for Naive Users

Some people don't want to be faced with a UNIX % or $ shell prompt. If you usually run only a few particular UNIX commands, you can put those command names in the shell prompt. Here's a simple one-line Bourne shell prompt for a .profile:

PS1='Type "rn", "mailx", "wp", or "logout": '

Next, a multiline prompt (7.5) for the C shell .cshrc file:

($?prompt) 







if ($?prompt) then
set prompt='\\

Type "rn" to read the news,\\
type "mailx" to read and send mail,\\
type "wp" for word processing, or\\
type "logout" to log out.\\
YES, MASTER? '
endif

You get the idea.

- JP


Previous: 7.6 Session Information in Your Terminal's Status Line UNIX Power ToolsNext: 7.8 Highlighting in Shell Prompts
7.6 Session Information in Your Terminal's Status Line Book Index7.8 Highlighting in Shell Prompts

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System