How do I format the prompt at level 3? One of my accounts has it right, but not the other. I guessed that it was in .tcshrc which was missing from the bad account so I copied it from the good account, but it made no difference.
Thanks, Mike.
Mike - email ignored wrote:
How do I format the prompt at level 3? One of my accounts has it right, but not the other. I guessed that it was in .tcshrc which was missing from the bad account so I copied it from the good account, but it made no difference.
depends on what shell you're using.... bash uses $HOME/.bash_profile
On Tue, 17 Nov 2009 22:11:55 -0800, John R Pierce wrote:
Mike - email ignored wrote:
How do I format the prompt at level 3? One of my accounts has it right, but not the other. I guessed that it was in .tcshrc which was missing from the bad account so I copied it from the good account, but it made no difference.
depends on what shell you're using.... bash uses $HOME/.bash_profile
Its bash. Following from .bash_profile to .bashrc to /etc/bashrc, and noting that at level 3, $TERM=linux, I should be calling /etc/sysconfig/bash-prompt-default, if I have one, which I don't.
But root gets it right, and myUser gets it wrong.
cd; grep -i .*
shows only the .tcshrc which I should have realized is not the one. So how is root getting it right?
Mike.
On Tue, 17 Nov 2009 22:11:55 -0800, John R Pierce wrote:
Mike - email ignored wrote:
How do I format the prompt at level 3? One of my accounts has it right, but not the other. I guessed that it was in .tcshrc which was missing from the bad account so I copied it from the good account, but it made no difference.
depends on what shell you're using.... bash uses $HOME/.bash_profile
Its bash. Following from .bash_profile to .bashrc to /etc/bashrc, and noting that at level 3, $TERM=linux, I should be calling /etc/sysconfig/bash-prompt-default, if I have one, which I don't.
But root gets it right, and myUser gets it wrong.
cd; grep -i .*
shows only the .tcshrc which I should have realized is not the one. So how is root getting it right?
Ah! Permission/ownership problem?
mark
On Wed, 18 Nov 2009 08:25:48 -0700, m.roth-x6lchVBUigD1P9xLtpHBDw wrote: [...]
Ah! Permission/ownership problem?
mark
Good suggestion. I found that for myUser .bashrc had the wrong permissions and .bash_profile was missing! I am sure that this happened because I copied /home/myUser was copied in from backup before the account was created. We won't do that again.
But now, I still do not see how the prompt is set since I have no /etc/sysconfig/bash-prompt-default .
Mike.
On Wed, 18 Nov 2009 08:25:48 -0700, m.roth-x6lchVBUigD1P9xLtpHBDw wrote: [...]
Ah! Permission/ownership problem?
Good suggestion. I found that for myUser .bashrc had the wrong permissions and .bash_profile was missing! I am sure that this happened because I copied /home/myUser was copied in from backup before the account was created. We won't do that again.
But now, I still do not see how the prompt is set since I have no /etc/sysconfig/bash-prompt-default .
From the code /etc/bashrc:
<...> screen) if [ -e /etc/sysconfig/bash-prompt-screen ]; then PROMPT_COMMAND=/etc/sysconfig/bash-prompt-screen else PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}"; echo -ne "\033\"' fi ;; <...>
mark
On Wed, 18 Nov 2009 09:22:44 -0700, m.roth-x6lchVBUigD1P9xLtpHBDw wrote:
On Wed, 18 Nov 2009 08:25:48 -0700, m.roth-x6lchVBUigD1P9xLtpHBDw wrote: [...]
Ah! Permission/ownership problem?
Good suggestion. I found that for myUser .bashrc had the wrong permissions and .bash_profile was missing! I am sure that this happened because I copied /home/myUser was copied in from backup before the account was created. We won't do that again.
But now, I still do not see how the prompt is set since I have no /etc/sysconfig/bash-prompt-default .
From the code /etc/bashrc:
<...> screen) if [ -e /etc/sysconfig/bash-prompt-screen ]; then PROMPT_COMMAND=/etc/sysconfig/bash-prompt-screen else PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}"; echo -ne "\033\"' fi ;; <...>
mark
Not so. With this debug:
---
echo TERM = $TERM
# are we an interactive shell? if [ "$PS1" ]; then case $TERM in xterm*) if [ -e /etc/sysconfig/bash-prompt-xterm ]; then PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm else PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/# $HOME/~}"; echo -ne "\007"' fi ;; screen) echo doing screen if [ -e /etc/sysconfig/bash-prompt-screen ]; then PROMPT_COMMAND=/etc/sysconfig/bash-prompt-screen else PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/ ~}"; echo -ne "\033\"' fi ;; *) echo doing default [ -e /etc/sysconfig/bash-prompt-default ] && PROMPT_COMMAND=/etc/ sysconfig/bash-prompt-default ;; esac
---
I get:
TERM = linux doing default
The mystery remains.
Mike.
Mike - email ignored wrote:
On Wed, 18 Nov 2009 09:22:44 -0700, m.roth-x6lchVBUigD1P9xLtpHBDw wrote:
But now, I still do not see how the prompt is set since I have no /etc/sysconfig/bash-prompt-default .
From the code /etc/bashrc:
<...> screen) if [ -e /etc/sysconfig/bash-prompt-screen ]; then PROMPT_COMMAND=/etc/sysconfig/bash-prompt-screen else PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}"; echo -ne "\033\"' fi ;; <...>
mark
Not so. With this debug:
<snip>
I get:
TERM = linux doing default
The mystery remains.
what do you get with these: echo $PROMPT_COMMAND echo $PS1
if $PROMPT_COMMAND has a value you could grep for it (or for PROMPT_COMMAND) in /etc and subdirs, and try to find it?
On Wed, 18 Nov 2009 17:48:58 +0100, Nicolas Thierry-Mieg wrote:
Mike - email ignored wrote:
[...]
I get:
TERM = linux doing default
The mystery remains.
what do you get with these: echo $PROMPT_COMMAND echo $PS1
if $PROMPT_COMMAND has a value you could grep for it (or for PROMPT_COMMAND) in /etc and subdirs, and try to find it?
[myUser@mbrc40 ~]$ echo $PROMPT_COMMAND
[myUser@mbrc40 ~]$ echo $PS1 [\u@\h \W]$
On Wed, Nov 18, 2009 at 8:48 AM, Nicolas Thierry-Mieg Nicolas.Thierry-Mieg@imag.fr wrote:
what do you get with these: echo $PROMPT_COMMAND echo $PS1
Isn't Mike (the OP) asking about PS3 rather than PS1 ?
On Wed, Nov 18, 2009 at 12:19 PM, Bart Schaefer barton.schaefer@gmail.com wrote:
Isn't Mike (the OP) asking about PS3 rather than PS1 ?
I interpreted his question to be asking about PS1 at runlevel 3, but it was a bit hazy given the terminology used.
On Wed, 18 Nov 2009 09:22:44 -0700, m.roth-x6lchVBUigD1P9xLtpHBDw wrote: Mike wrote:
On Wed, 18 Nov 2009 08:25:48 -0700, m.roth-x6lchVBUigD1P9xLtpHBDw wrote: [...]
But now, I still do not see how the prompt is set since I have no /etc/sysconfig/bash-prompt-default .
From the code /etc/bashrc:
<...> screen) if [ -e /etc/sysconfig/bash-prompt-screen ]; then PROMPT_COMMAND=/etc/sysconfig/bash-prompt-screen else PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}"; echo -ne "\033\"' fi ;; <...>
<snipo>
I get:
TERM = linux doing default
The mystery remains.
No, we're getting closer. What you need to find out is what's setting TERM to linux, which is further back than /etc/bashrc. Is the user logging directly onto the Linux box, or are they from, say, a WinDoze box via putty, or ...?
mark
On Wed, 18 Nov 2009 09:50:54 -0700, m.roth-x6lchVBUigD1P9xLtpHBDw wrote:
[...]
No, we're getting closer. What you need to find out is what's setting TERM to linux, which is further back than /etc/bashrc. Is the user logging directly onto the Linux box, or are they from, say, a WinDoze box via putty, or ...?
mark
Direct.
Mike.
Hi,
I'd try this as a quickshot:
find /etc /root /home -type f -exec grep -l PS3 {} ;
than I'd take a closer look at the files that will show up. And I'd read bash(1) closely to learn which files are being read in which order and especially when.
If all of the above doesn't lead me anywhere, I'd start poking around on a mailing list to see if somebody could explain me what's going on, but maybe that's just me.
Frank.
On Wed, 18 Nov 2009 18:00:25 +0100, Frank.Brodbeck-E4aVwrWTXLGELgA04lAiVw wrote:
Hi,
I'd try this as a quickshot:
find /etc /root /home -type f -exec grep -l PS3 {} ;
than I'd take a closer look at the files that will show up. And I'd read bash(1) closely to learn which files are being read in which order and especially when.
If all of the above doesn't lead me anywhere, I'd start poking around on a mailing list to see if somebody could explain me what's going on, but maybe that's just me.
Frank.
[root@mbrc40 ~]# find /etc /root /home -type f -exec grep -l PS3 {} ; /etc/termcap /etc/pki/tls/certs/ca-bundle.crt /etc/alsa/cards/PS3.conf /root/.ssh/exe/psftp.exe /root/.ssh/exe/putty.exe /root/.mozilla/firefox/l2cth6mq.default/Cache/61FD9500d01 /root/nvidia/NVIDIA-Linux-x86-190.42-pkg1.run [... I removed results in .pan2]
In termcap, it is in a comment.
in ca-bundle.crt, its in the base64 (don't tell anyone)
Nothing else seems relevant.
Mike.
Mike - email ignored wrote:
On Wed, 18 Nov 2009 09:22:44 -0700, m.roth-x6lchVBUigD1P9xLtpHBDw wrote:
On Wed, 18 Nov 2009 08:25:48 -0700, m.roth-x6lchVBUigD1P9xLtpHBDw wrote: [...]
Ah! Permission/ownership problem?
Good suggestion. I found that for myUser .bashrc had the wrong permissions and .bash_profile was missing! I am sure that this happened because I copied /home/myUser was copied in from backup before the account was created. We won't do that again.
But now, I still do not see how the prompt is set since I have no /etc/sysconfig/bash-prompt-default . From the code /etc/bashrc:
<...> screen) if [ -e /etc/sysconfig/bash-prompt-screen ]; then PROMPT_COMMAND=/etc/sysconfig/bash-prompt-screen else PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}"; echo -ne "\033\"' fi ;; <...>
mark
Not so. With this debug:
echo TERM = $TERM
# are we an interactive shell? if [ "$PS1" ]; then case $TERM in xterm*) if [ -e /etc/sysconfig/bash-prompt-xterm ]; then PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm else PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/# $HOME/~}"; echo -ne "\007"' fi ;; screen) echo doing screen if [ -e /etc/sysconfig/bash-prompt-screen ]; then PROMPT_COMMAND=/etc/sysconfig/bash-prompt-screen else PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/ ~}"; echo -ne "\033\"' fi ;; *) echo doing default [ -e /etc/sysconfig/bash-prompt-default ] && PROMPT_COMMAND=/etc/ sysconfig/bash-prompt-default ;; esac
I get:
TERM = linux doing default
The mystery remains.
That looks right for a direct console login. What did you expect to happen?
Mike - email ignored wrote:
On Wed, 18 Nov 2009 08:25:48 -0700, m.roth-x6lchVBUigD1P9xLtpHBDw wrote: [...]
Ah! Permission/ownership problem?
mark
Good suggestion. I found that for myUser .bashrc had the wrong permissions and .bash_profile was missing! I am sure that this happened because I copied /home/myUser was copied in from backup before the account was created. We won't do that again.
But now, I still do not see how the prompt is set since I have no /etc/sysconfig/bash-prompt-default .
Neither do I - just /etc/bashrc
Mike.
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos