* System Prompt - Put Path in prompt
@ 1995-06-16 4:00 Robert Cerniglia
1995-06-18 4:00 ` Reece Hart
1995-06-19 4:00 ` oberman
0 siblings, 2 replies; 5+ messages in thread
From: Robert Cerniglia @ 1995-06-16 4:00 UTC (permalink / raw)
I'm trying to find somebody who can tell me where to find or how to
write a script that will display my Current working directory as my system
prompt.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: System Prompt - Put Path in prompt
1995-06-16 4:00 System Prompt - Put Path in prompt Robert Cerniglia
@ 1995-06-18 4:00 ` Reece Hart
1995-06-19 4:00 ` Tim Lucia
1995-06-19 4:00 ` oberman
1 sibling, 1 reply; 5+ messages in thread
From: Reece Hart @ 1995-06-18 4:00 UTC (permalink / raw)
Robert Cerniglia <peitechs@fast.net> writes:
>I'm trying to find somebody who can tell me where to find or how to
>write a script that will display my Current working directory as my system
>prompt.
It depends on which shell you use. Certain shells allow format
characters in the prompt string which expand to the current path. I
know bash does and I believe tcsh does also; others may as well, but I
don't use them. The man page for your shell should describe special
prompt codes.
I don't know if csh allows prompt codes. If note and you're using
csh, you can do something like
alias cd 'cd \!*; set prompt=$cwd%'
I'm not a csh user and there may be easier ways. Again, see the man
page.
--
Reece Kimball Hart | email: reece@dasher.wustl.edu
Biophysics & Biochemistry, Box 8231 | WWW: http://dasher.wustl.edu/~reece/
Washington Univ. School of Medicine | Phone: (314) 362-4198 (lab)
660 South Euclid | -7183 (fax)
St. Louis, Missouri 63110 (USA) | PGP public key available by finger & WWW
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: System Prompt - Put Path in prompt
1995-06-18 4:00 ` Reece Hart
@ 1995-06-19 4:00 ` Tim Lucia
0 siblings, 0 replies; 5+ messages in thread
From: Tim Lucia @ 1995-06-19 4:00 UTC (permalink / raw)
I use ksh. The following does what you want for ksh:
export PS1='${PWD#$HOME/}> '
where the #$HOME/ removes the /usr/users/lucia portion, giving me
a directory relative to /usr/users/lucia as my prompt.
--
Timothy J. Lucia - DECladebug Email: mailto:lucia@zko.dec.com
Digital Equipment Corporation Phone: 603.881.2615
110 Spitbrook Road ZKO2-3/K06 Fax: 603.881.0120
Nashua, NH USA 03062-2698 I'd rather be fishing, thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: System Prompt - Put Path in prompt
1995-06-16 4:00 System Prompt - Put Path in prompt Robert Cerniglia
1995-06-18 4:00 ` Reece Hart
@ 1995-06-19 4:00 ` oberman
1995-06-20 4:00 ` g0daeniken
1 sibling, 1 reply; 5+ messages in thread
From: oberman @ 1995-06-19 4:00 UTC (permalink / raw)
In Article <3rsqc3$h3p@nn.fast.net>
Robert Cerniglia <peitechs@fast.net> writes:
>I'm trying to find somebody who can tell me where to find or how to
>write a script that will display my Current working directory as my system
>prompt.
What shell are you using? If it's tcsh, it's directly supported with
"set prompt=%\" or, for a friendlier and shorter presentation,
"set prompt=%~".
See the man pages of the shell you use for more information. And I have yet to
talk to anyone who uses tcsh who wants to ge to any other shell.
R. Kevin Oberman
Energy Sciences Network (ESnet)
National Energy Research Supercomputer Center (NERSC)
Lawrence Livermore National Laboratory (LLNL)
Internet: koberman@llnl.gov +1 510-422-6955
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: System Prompt - Put Path in prompt
1995-06-19 4:00 ` oberman
@ 1995-06-20 4:00 ` g0daeniken
0 siblings, 0 replies; 5+ messages in thread
From: g0daeniken @ 1995-06-20 4:00 UTC (permalink / raw)
In article <3s46pj$9gt@lll-winken.llnl.gov>, oberman@icaen.llnl.gov writes:
> In Article <3rsqc3$h3p@nn.fast.net>
> Robert Cerniglia <peitechs@fast.net> writes:
>>I'm trying to find somebody who can tell me where to find or how to
>>write a script that will display my Current working directory as my system
>>prompt.
>
> What shell are you using? If it's tcsh, it's directly supported with
> "set prompt=%\" or, for a friendlier and shorter presentation,
> "set prompt=%~".
And in ksh, you have to include the line
export PS1='!$PWD> '
in your home directory's .profile
The ! is optional, it displays the history counter.
regards,
Eric
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~1995-06-20 4:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-06-16 4:00 System Prompt - Put Path in prompt Robert Cerniglia
1995-06-18 4:00 ` Reece Hart
1995-06-19 4:00 ` Tim Lucia
1995-06-19 4:00 ` oberman
1995-06-20 4:00 ` g0daeniken
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox