delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/09/19/16:04:27

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT sourceware DOT cygnus DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <37E5412D.A9E0E0C0@earthlink.net>
Date: Sun, 19 Sep 1999 13:01:49 -0700
From: "Kevin L. McWhirter" <klmcw AT earthlink DOT net>
X-Mailer: Mozilla 4.61 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
To: Leonardo Pedrosa <lion AT sti DOT com DOT br>,
cygwin list <cygwin AT sourceware DOT cygnus DOT com>
Subject: Re: prompt problem
References: <37E536EC DOT D3138B17 AT sti DOT com DOT br>

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 AT sourceware DOT cygnus DOT com


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019