ksh Prompt Customization

| | Comments (1)

I continually forget how to do this (because I usually set it up once and never again), so I'm making a quick note of how to show the shortened hostname, username and current directory at the prompt under ksh (the default shell for OpenBSD). In the standard .profile file, enter:

HOST=`hostname`
export PS1='${USER}@${HOST%%.*} ${PWD##*/} $ '

There are ways to add color, etc. to this, but I like the plain, vanilla look it produces. Finally, I won't be likely to run commands on a machine where I shouldn't be.

1 Comments

Actually OpenBSD is using a modified version of pdksh.

Leave a comment

About this Entry

This page contains a single entry by steven n fettig published on November 16, 2007 9:12 AM.

Testing the Nikon 80-400mm f/4.5-5.6 AF VR lens - not for sports (read on) was the previous entry in this blog.

Keyboards, lifeline to liking a computer; Apple's new (2007) wireless keyboard and my little review is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Contact

Steven N. Fettig
Delavan, WI - somewhere between Delavan & Darien: map link
Phone: +1 262 432 1704
Email: snfettig AT gmail.com
AIM/Yahoo/MSN/GoogleTalk-
Skype/twitter:
snfettig

Technorati

Technorati search

» Blogs that link here

Powered by Movable Type 4.21-en