public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* prompt problem
@ 1999-09-19 12:22 Leonardo Pedrosa
  1999-09-19 13:03 ` Kevin L. McWhirter
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Leonardo Pedrosa @ 1999-09-19 12:22 UTC (permalink / raw)
  To: cygwin

Hello, I'm starting with the cygwin recently and due my lack of
knowledge I have this basic/fool question:
When a I run Cygnus form Windows98 the prompt stay fixed at
BASH.EXE-2.02$
How can I set it like the "prompt $p$g" command of MS-DOS ?

Thank you.
Leonard


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: prompt problem
  1999-09-19 12:22 prompt problem Leonardo Pedrosa
@ 1999-09-19 13:03 ` Kevin L. McWhirter
  1999-09-30 23:42   ` Kevin L. McWhirter
  1999-09-19 21:47 ` Florian Weimer
  1999-09-30 23:42 ` Leonardo Pedrosa
  2 siblings, 1 reply; 6+ messages in thread
From: Kevin L. McWhirter @ 1999-09-19 13:03 UTC (permalink / raw)
  To: Leonardo Pedrosa, cygwin list

The only TRULY foolish question is the one that was not asked!

Most UNIX shells have the concept of multiple prompts. Most notable of
those are:
(1) At the command line
(2) When at an extended line from the command line

These are represented by the environment variables PS1 and PS2
respectively.

With ksh and bash these *can* be evaluated when they are displayed to
give them a dynamic feel. Bash has extensions to the functionality that
ksh provides.  The bash man page/info file will provide the full
documentation. But the short answer to your question is:

MSDOS 'prompt $p$g'  is equivalent to export PS1='\w >'

A more typical setting would be '\h \w >' . The \h provides the host
name.  I usually use something like: export PS1=$(uname -n)'-$PWD->'

Note that the $(uname -n) is eval-ed when the variable is assigned
whereas the hard-quoted '$PWD' is evaluated when displayed.  This way I
figure out what machine I am on only once. And it is compatible with ksh
(under different platforms).

I hope that helps!
Kevin

Leonardo Pedrosa wrote:

> Hello, I'm starting with the cygwin recently and due my lack of
> knowledge I have this basic/fool question:
> When a I run Cygnus form Windows98 the prompt stay fixed at
> BASH.EXE-2.02$
> How can I set it like the "prompt $p$g" command of MS-DOS ?
>
> Thank you.
> Leonard
>
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe@sourceware.cygnus.com


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: prompt problem
  1999-09-19 12:22 prompt problem Leonardo Pedrosa
  1999-09-19 13:03 ` Kevin L. McWhirter
@ 1999-09-19 21:47 ` Florian Weimer
  1999-09-30 23:42   ` Florian Weimer
  1999-09-30 23:42 ` Leonardo Pedrosa
  2 siblings, 1 reply; 6+ messages in thread
From: Florian Weimer @ 1999-09-19 21:47 UTC (permalink / raw)
  To: cygwin

Leonardo Pedrosa <lion@sti.com.br> writes:

> How can I set it like the "prompt $p$g" command of MS-DOS ?

It's documented in the bash manual.  You have to change the PS1 and PS2
variables. Have a look at `Printing a Prompt' in section `Bash Features'
as well.

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* prompt problem
  1999-09-19 12:22 prompt problem Leonardo Pedrosa
  1999-09-19 13:03 ` Kevin L. McWhirter
  1999-09-19 21:47 ` Florian Weimer
@ 1999-09-30 23:42 ` Leonardo Pedrosa
  2 siblings, 0 replies; 6+ messages in thread
From: Leonardo Pedrosa @ 1999-09-30 23:42 UTC (permalink / raw)
  To: cygwin

Hello, I'm starting with the cygwin recently and due my lack of
knowledge I have this basic/fool question:
When a I run Cygnus form Windows98 the prompt stay fixed at
BASH.EXE-2.02$
How can I set it like the "prompt $p$g" command of MS-DOS ?

Thank you.
Leonard


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: prompt problem
  1999-09-19 13:03 ` Kevin L. McWhirter
@ 1999-09-30 23:42   ` Kevin L. McWhirter
  0 siblings, 0 replies; 6+ messages in thread
From: Kevin L. McWhirter @ 1999-09-30 23:42 UTC (permalink / raw)
  To: Leonardo Pedrosa, cygwin list

The only TRULY foolish question is the one that was not asked!

Most UNIX shells have the concept of multiple prompts. Most notable of
those are:
(1) At the command line
(2) When at an extended line from the command line

These are represented by the environment variables PS1 and PS2
respectively.

With ksh and bash these *can* be evaluated when they are displayed to
give them a dynamic feel. Bash has extensions to the functionality that
ksh provides.  The bash man page/info file will provide the full
documentation. But the short answer to your question is:

MSDOS 'prompt $p$g'  is equivalent to export PS1='\w >'

A more typical setting would be '\h \w >' . The \h provides the host
name.  I usually use something like: export PS1=$(uname -n)'-$PWD->'

Note that the $(uname -n) is eval-ed when the variable is assigned
whereas the hard-quoted '$PWD' is evaluated when displayed.  This way I
figure out what machine I am on only once. And it is compatible with ksh
(under different platforms).

I hope that helps!
Kevin

Leonardo Pedrosa wrote:

> Hello, I'm starting with the cygwin recently and due my lack of
> knowledge I have this basic/fool question:
> When a I run Cygnus form Windows98 the prompt stay fixed at
> BASH.EXE-2.02$
> How can I set it like the "prompt $p$g" command of MS-DOS ?
>
> Thank you.
> Leonard
>
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe@sourceware.cygnus.com


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: prompt problem
  1999-09-19 21:47 ` Florian Weimer
@ 1999-09-30 23:42   ` Florian Weimer
  0 siblings, 0 replies; 6+ messages in thread
From: Florian Weimer @ 1999-09-30 23:42 UTC (permalink / raw)
  To: cygwin

Leonardo Pedrosa <lion@sti.com.br> writes:

> How can I set it like the "prompt $p$g" command of MS-DOS ?

It's documented in the bash manual.  You have to change the PS1 and PS2
variables. Have a look at `Printing a Prompt' in section `Bash Features'
as well.

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~1999-09-30 23:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-09-19 12:22 prompt problem Leonardo Pedrosa
1999-09-19 13:03 ` Kevin L. McWhirter
1999-09-30 23:42   ` Kevin L. McWhirter
1999-09-19 21:47 ` Florian Weimer
1999-09-30 23:42   ` Florian Weimer
1999-09-30 23:42 ` Leonardo Pedrosa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).