From owner-freebsd-questions@FreeBSD.ORG Sat Jan 1 18:02:27 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BE4A1065672 for ; Sat, 1 Jan 2011 18:02:27 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) by mx1.freebsd.org (Postfix) with ESMTP id 0A4BB8FC16 for ; Sat, 1 Jan 2011 18:02:26 +0000 (UTC) Received: from r55.edvax.de (port-92-195-37-207.dynamic.qsc.de [92.195.37.207]) by mx01.qsc.de (Postfix) with ESMTP id 12EE23D254; Sat, 1 Jan 2011 19:02:24 +0100 (CET) Received: from r55.edvax.de (localhost [127.0.0.1]) by r55.edvax.de (8.14.2/8.14.2) with SMTP id p01I2OJN001478; Sat, 1 Jan 2011 19:02:24 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Sat, 1 Jan 2011 19:02:23 +0100 From: Polytropon To: Chris Brennan Message-Id: <20110101190223.2fda2da6.freebsd@edvax.de> In-Reply-To: References: <20101231211542.GA8373@thought.org> <20110101110131.26d20d64.freebsd@edvax.de> <20110101120141.GA26489@thought.org> Organization: EDVAX X-Mailer: Sylpheed 2.4.7 (GTK+ 2.12.1; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Gary Kline , Polytropon , Mailing List , FreeBSD Subject: Re: cshrc to bashrc?? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jan 2011 18:02:27 -0000 On Sat, 1 Jan 2011 10:56:24 -0500, Chris Brennan wrote: > > > > > Note that csh does automatically use % or # according to the > > > first setting. I'm not sure how bash handles this. > > > > man bash and search for PROMPTING, everything you can pass PS1 is there > > # is \# the command number of this command > > I don't see how a '%' is handled tho, what does it do is csh? I (or someone > else) may know the bash equivalent... The csh and bash config do use differnt "escape sequences" for substitution, such as user name, host name, current directory and "power" (root / non-root). In bash it is \, in csh it is %. You are right, "man bash" does list all the sequences, as well as "man csh". For the standard prompt user@host:~/my/path% _ those are the corresponding codes: Meaning csh bash -------------- ------ ------ user %n \u host %m \h path \w %~ (includes substitution ~) prompt sign %# (# for root, % for non-root) \$ (# for root, $ for non-root) That's why I said csh's set prompt = "%n@%m:%~%# " equals bash's export PS1="\u@\h:\w\$ ", because bash does have a different default prompt (which might not be desired). A literal % can be used for bash's PS1 setting if intended. But it's okay to see $ for bash, and % for csh. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...