bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to include `$$' literally in the PS1 prompt?


From: Clark J. Wang
Subject: How to include `$$' literally in the PS1 prompt?
Date: Sun, 30 Sep 2007 12:28:57 +0800

I want to show the bash PID in my prompt. For example, if the PID of shell
is 12345 I want the prompt to look like this:

[$$=12345 ~/tmp] #

If I set PS1 like this:

PS1='[$$=$$ \w] \$ '

then both `$$' would be expanded to 12345. If I set PS1 like this:

PS1='[\$\$=$$ \w] \$ '

then `\$\$' would be expanded to `##'. At last I tried like this:

PS1='[\044\044=$$ \w] \$ '

but it turned out to be the same as the first one!

Anybody has any idea?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]