Why there is a "command not found" prompt every time I open the Terminal?
the prompt looks like:
bash: $'\357\273\277#': commands not found. [root@localhost ~]# cat .bashrc # .bashrc # User specific aliases and functions alias rm='rm -i' alias cp='cp -i' alias mv='mv -i' alias vi='vim' # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi |
looks like your prompt settings is not ok.
see http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x279.html |
Member response
Hi,
This is a sample setup for both .bashrc & .bash_profile(which is used to source the .bashrc) for users home; Code:
sample .bash_profile for proper sourcing with users home; Code:
sample .bashrc; HTH! |
Thanks. but it seems that .bashrc is fine.
I edited my .bashrc: 1 #Cricket .bashrc 2 ...... Then I open a new terminal or a new tab in terminal, it prompts: bash: $'\357\273\277#Cricket': commands not found. There is nothing to do with the rest content of my .bashrc. But I don't still know where the first three letters come from. weird... |
Hi,
Quote:
Code:
# Source global definitions |
Quote:
|
Is $PROMPT_COMMAND set?
|
Quote:
printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}" |
I tried the following:
PS1=`bla`, the result was: bash: bla: command not found so try to set PS1 to '>' or some simple string.... |
The sequence \357\273\277 is the octal representation of the Byte Order Mark of UTF-8 character encoding. Here is a comparative table:
Code:
Hex | EF BB BF 1. make your terminal UTF-8 capable 2. convert all the UTF-8 files to another encoding, e.g. plain ASCII Another question: what is the output of the following commands? Code:
echo $PS1 | od -c |
Quote:
How to make my terminal UTF-8 capable? Here are the output: [root@localhost ~]# echo $PS1 | od -c 0000000 [ \ u @ \ h \ W ] \ $ \n 0000015 [root@localhost ~]# echo -e $PS1 | od -c 0000000 [ \ u @ \ h \ W ] \ $ \n 0000015 |
Quote:
Code:
locale Code:
bash: $'\357\273\277#': commands not found. |
Quote:
Quote:
What happens if you unset it and set a simple PS1 prompt as pan64 suggested: Code:
unset PROMPT_COMMAND |
Quote:
|
Quote:
Code:
[root@localhost JRDJ]# locale |
All times are GMT -5. The time now is 07:52 AM. |