Solved

Ksh - Prompt shows path

Posted on 2004-10-14
4
1,902 Views
Last Modified: 2012-06-21
How do you set the prompt to show current directory in ksh?  It's easy in cshell.

alias cd 'cd \!*; set prompt="['hostname']<$cwd> ";
0
Comment
Question by:lcor
  • 3
4 Comments
 
LVL 48

Expert Comment

by:Tintin
ID: 12312184
Even easier in ksh.

export PS1='$PWD$ '

0
 
LVL 48

Accepted Solution

by:
Tintin earned 500 total points
ID: 12312194
If you want exactly the same format as the csh version, do

export PS1='[$HOSTNAME]<$PWD> '
0
 
LVL 38

Expert Comment

by:yuzh
ID: 12314289
You can put the followings in your .profile:

   HOSTNAME=$(hostname)
   PWD=$(pwd)
   PS1='${HOSTNAME}[${PWD}] !# '

0
 
LVL 48

Expert Comment

by:Tintin
ID: 12315581
yuhz.

No need to set PWD.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Unistall fileset without dependecies on AIX 3 60
reinstall 1 70
Linux : adding the new user with password option, 11 97
Linux: disable vim auto-comment 7 98
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now