Results 1 to 2 of 2
The following line is in the /etc/bashrc file. I was trying to decipher it but no google results explain it in detail.
PROMPT_COMMAND='echo -ne "3]0;${USER}${HOSTNAME%%.*}:${PWD/#$HOME/~}
Thread: xterm config in /etc/bashrc
7"' I understand that 3 is ...- 10-18-2010 #1Just Joined!
- Join Date
- Oct 2010
- Posts
- 1
xterm config in /etc/bashrc
The following line is in the /etc/bashrc file. I was trying to decipher it but no google results explain it in detail.
PROMPT_COMMAND='echo -ne "\033]0;${USER}${HOSTNAME%%.*}:${PWD/#$HOME/~}\007"'
I understand that \033 is the ASCII character for ESC but not sure what ]0 does or anything after the HOSTNAME variable.
TIA
- 10-22-2010 #2Just Joined!
- Join Date
- Oct 2010
- Location
- Reston, VA
- Posts
- 26
Lrrr,
While I don't have all the codes in memory here is some of it:
The surrounding "ticks" mean execute the command. The result of the command will become the value of the PROMPT_COMMAND variable.
echo -ne means to echo, allow for escaped characters, and do not end with a new line.
${USER} means to insert the value of the variable USER.
For more information look at
man bash
see the sections:
"Brace Expansion" and "Parameter Expansion"
Fair warning it's heavy reading if you're not already into shell scripting.
-Gooney0


Reply With Quote