From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,1d3d704021ddfe52 X-Google-Attributes: gidfee84,public From: jmeyers@vega.wright.edu (John Meyers, Computing Services) Subject: Re: Need to display $PWD in prompt using /bin/ksh Date: 1996/11/29 Message-ID: <1996Nov29.220606@vega.wright.edu>#1/1 X-Deja-AN: 201497148 references: organization: Wright State University newsgroups: comp.unix.osf.osf1 In article , rshwake@atww.org (Raymond N Shwake) writes: > clos@ivory.trentu.ca writes: > >>We are using Korn shell (/bin/ksh) and I would like to have the shell display >>my present working directory ($PWD) in my command prompt evertime I "cd" to a >>different directory. I have tried the following aliases in my .profile but with >>out success: >> >> alias p='PS1=`hostname|cut -d. -f1`":$PWD#"' >> alias cd='cd \!* ; p' You could always define a shell function in your .profile as, cdp () { cd $* PS1="`hostname|cut -f1 -d.`:`basename $PWD`> " } alias cd=cdp Just a reminder that you can display ksh funtions using the 'typeset -f' command. :) John Meyers Computing Services E-Mail: jmeyers@wright.edu