Add Site or Add Page to Favorites
>

 Korn shell prompt 

Preview DRM-free music
Play clips of the most popular DRM-Free music in MP3 format
Legal Music .com

Get information on your favorite TV Shows at TV Series .com

Clarify the meaning of the acronyms on your web site.

Acronym Dictionary

Acronym Finder

Social Networking Web Sites

Register your own domain name at A to Z Domains.

or buy domains at Domain Names For Sale .net


Printer-friendly PDF* format:

Using the Korn Shell

This Section

Using the Korn Shell

For most users, the default prompt in the Korn shell is a dollar sign:

                        $
                        

For root, the prompt is a hash symbol:

                        #
                        

Changing the Korn shell prompt

The prompt can be changed by setting the PS1 environment variable. For example:

                        export PS1='$PWD ! $ '
                        
export PS1='${PWD#${PWD%/*/*}/} ! $ '
export PS1="$LOGNAME@`uname -n` \$PWD ! $ "

$PWD shows the path for the current directory. ${PWD#${PWD%/*/*}/} uses Korn shell pattern matching to show only the last two directories in the current directory path. ! shows the number of the command in the command history. When setting the prompt with a double-quoted ("...") string, unescaped variables, such as $LOGNAME above, and commands, such as `uname -n` above, are interpreted when the environment variable is exported, and therefore will not change unless the prompt is set again.

You are currently viewing this page in HTML 4* format (* see Clicklets for more infomation). This document is also available in XHTML 1 Style Sheet*XHTML 1* XML*HTML 5 Style Sheet*HTML 5 XML*HTML 5 non-XML* XHTML 2* XHTML Mobile* WML Mobile* and printer-friendly PDF* formats. This is accomplished with Single Source Publishing, a content management system that uses templates in XSLT style sheets provided by XML Styles .com to transform the source content for various content delivery channels. There is also RDF* metadata that describes the content of this document.


Copyright © 2006 How To Guides .com. Alteration of content, including addition of any function such as hypertext links or pop-up advertising, or interference with the hypertext links or other functions of this site is expressly prohibited.

DISCLAIMER: All information, links, forms, applications and other items on this site or obtained from it are provided AS IS, WITHOUT WARRANTY OF ANY KIND EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.