Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Couple of .profile convienences I don't remember?

Status
Not open for further replies.

eldarion99

Programmer
Mar 4, 2003
6
US
1) I used to be able to use Esc-K (Escape and k key) to retrieve the last command from .sh_history (it would take you to the command in vi mode so you could use vi commands to edit it also). Does anyone remember how to do this?

2) How do you change the prompt before the $ to JUST the directory you are in? It is currently showing my id and the name of the box, which I don't want.

I should've kept my old code from my last job!!!! This is easy to forget after several years of taking it for granted. Thanks for any help.
 
Make sure your user shell is ksh/bash


Make sure your editor is set to vi:
export EDITOR=/usr/bin/vi

For the prompt:
export PS1="[\$PWD] $ "


-jim
 
exporting the editor does the same thing as 'set -o vi'.
-jim
 

For BASH:

PS1="\w" Sets the prompt to the full directory
PS1="\W" Sets the prompt to the name of the directory (the last bit).

Cheers Henrik Morsing
Certified AIX 4.3 Systems Administration
& p690 Technical Support
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top