Date: Sat, 1 Jan 2011 19:02:23 +0100 From: Polytropon <freebsd@edvax.de> To: Chris Brennan <xaero@xaerolimit.net> Cc: Gary Kline <kline@thought.org>, Polytropon <freebsd@edvax.de>, Mailing List <freebsd-questions@freebsd.org>, FreeBSD Subject: Re: cshrc to bashrc?? Message-ID: <20110101190223.2fda2da6.freebsd@edvax.de> In-Reply-To: <AANLkTimeZk1seK=mJcXpdzezSAtpLKOPQR=N%2BdFdz-xr@mail.gmail.com> References: <20101231211542.GA8373@thought.org> <20110101110131.26d20d64.freebsd@edvax.de> <20110101120141.GA26489@thought.org> <AANLkTimeZk1seK=mJcXpdzezSAtpLKOPQR=N%2BdFdz-xr@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 1 Jan 2011 10:56:24 -0500, Chris Brennan <xaero@xaerolimit.net> 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, ...
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110101190223.2fda2da6.freebsd>