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