On Sat, 1 Jan 2011 10:56:24 -0500, Chris Brennan <[email protected]> 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

        u...@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 = "%...@%m:%~%# " equals
bash's export PS1="\...@\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, ...
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[email protected]"

Reply via email to