Bourne Shell Question?

Tom Kopp tkopp at carroll1.UUCP
Thu Feb 2 07:09:59 AEST 1989


In article <8517 at dasys1.UUCP>, dap9702 at dasys1.UUCP (Dan Powers) writes:
>   Does anyone know how to get a prompt in Bourne Shell that contains the
> current working directory (pwd). I can get this to work in C shell by 
> specifing an alias for cd as 'cd \!*;set prompt="[`pwd`]% "'. Any and all
> help would be appreciated.
> DP

I have not yet seen this done on a Bourne Shell, and I have asked a few
people and none of them know how to do it.  I seem to remember an easier
way to do it in csh, but I cannot remember (has been 6 mos + since I've 
seen the method).  Some particular reason you need it in Bourne shell only?
The only shell I have figured out how to do it in is Korn shell.  As an 
example, using

PS1='$PWD >'

gives me

/assist/tkopp >

when in home directory.


-- 
"Those who do not understand Unix      |Thomas J. Kopp
are condemned to re-invent it, Poorly" |tkopp at carroll1.UUCP
- Henry Spencer                        |uunet!marque!carroll1!tkopp



More information about the Comp.unix.questions mailing list