On Sunday February 22 2009, Bob S wrote:
...
Made the direct file changes you suggested. It worked, somewhat. Konsole changed to the proper hostname but it keeps adding the "~Documents" to the name. Don't know where or how to change that, Oh well. Thanks again.
This is BASH interpolating values into your prompt. There are a special set of character sequences that are interpreted in the PS1 string. E.g., my basic prompt is this: PS1='\!> ' This produces prompts that have the history numer (\!), a greater-than sign and a space (I'm a minimalist). But whenever I'm running in a terminal emulator, I use this prompt string (view this with a fixed-width font): PS1=$'\\[\e]0; \\u :: \\W (\\w)\a\\]\\!> ' ^ !!!***** +++ === %%% $$!!! @@ Key: ^: In BASH, a single-quoted string prefixed by a $ interprets ASCII escape sequences similar to those in C and other programming and scripting languages including: \a (BEL / CTRL-G), \e (ESC), \r (CR / CTRL-M), \n (NL / CTRL-J), \\ (backslash), etc. !!!: \\[ and \\]: These demarcate portions of the prompt that don't print and hence don't take up space. BASH needs to know this so it can properly track which column the cursor is in after the prompt has been printed. *****: \E]0; Terminal emulator escape sequence that marks the beginning of the title sequence, which usually gets displayed in the window title bar. $$: \a / BEL / CTRL-G: Terminal emulator sequence that marks the end of the title sequence that began following *****. \\u: BASH inserts the user name here \\W: BASH inserts the base part of current working directory here \\w: BASH inserts the current working directory here Note that both the simple and the fancy PS1 strings I gave above produce the same result in Konsole. All the "fancy" parts involve putting information into the Konsole window title bar, leaving the prompt containing just the history number. So the reason you're seeing your current directory in your prompt is because it includes the escape sequence "\w". There are several other expansion sequences that BASH interprets in the PS1 string. Check the manual page for complete information. Note that not all terminal emulators implement the same escape sequences, but Konsole works as I described above (as do most terminal emulators today).
Bob S
Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org