You are not logged in.

#1 2010-07-27 15:31:34

kennnn
Member
Registered: 2010-02-18
Posts: 14

bash all messed up, wtf have I done?

After tweaking my .bashrc I fired up a new terminal and get this.

: command not found
: command not found
: command not found
: command not found
[kennnn@cloud ~]$

also the cursor precedes the name@host.

Even after making a fresh .bashrc from /etc/skel I get the same problem, wtf have I done please?

Offline

#2 2010-07-27 15:36:59

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: bash all messed up, wtf have I done?

> Even after making a fresh .bashrc from /etc/skel I get the same problem, wtf have I done please?
Check for any environmental variables that look suspicious and reboot.

Offline

#3 2010-07-27 15:49:22

kennnn
Member
Registered: 2010-02-18
Posts: 14

Re: bash all messed up, wtf have I done?

Thanks for the quick reply, how can I do that? /etc/profile?

Offline

#4 2010-07-27 15:52:53

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: bash all messed up, wtf have I done?

Did you export any variables? What's your PROMPT_COMMAND?

env | less

to view currently set variables,

env | grep -i prompt

to check PROMPT_COMMAND.

Offline

#5 2010-07-27 15:58:17

kennnn
Member
Registered: 2010-02-18
Posts: 14

Re: bash all messed up, wtf have I done?

This is what I have

env | grep -i prompt
PROMPT_COMMAND=echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\007"

Is that ok, I can't ever remember changing the varibles.

Last edited by kennnn (2010-07-27 15:59:29)

Offline

#6 2010-07-27 16:05:10

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: bash all messed up, wtf have I done?

Unset the variable [1], because the escape sequences (\033] and friends) might be triggering some unexpected behavior.

[1]
Run

export PROMPT_COMMAND="history -a"
env | grep -i prompt

Open a new terminal and see if it works OK.

Last edited by karol (2010-07-27 16:06:41)

Offline

#7 2010-07-27 16:14:53

kennnn
Member
Registered: 2010-02-18
Posts: 14

Re: bash all messed up, wtf have I done?

Thanks karol , but it didn't sort it

Offline

#8 2010-07-27 16:21:34

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: bash all messed up, wtf have I done?

There are also other files that may be of interest, like /etc/bash.bashrc.local, but if you didn't mess them up I don't think they hold anything out of ordinary.

If after a reboot you still have problem post the tweaks you applied to your .bashrc.

Offline

#9 2010-07-27 16:21:49

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: bash all messed up, wtf have I done?

Check the other files sourced at login -- ~/.bash_profile or ~/.profile might be at fault.

Offline

#10 2010-07-27 16:51:39

kennnn
Member
Registered: 2010-02-18
Posts: 14

Re: bash all messed up, wtf have I done?

Nothing seems suspicious to me, however I've got my newbie hat on.

This is what I've got

#
# /etc/bash.bashrc
#
# This file is the systemwide bashrc file. While most of the
# environment is preserved when running an interactive shell
# the PS[1-4] variables, aliases and functions are reset.
#
# When running a non-login shell, apply the following settings:
# - Prompt defaults (PS[1-4], PROMPT_COMMAND)
# - bash_completion if it exists
# - source /etc/bash.bashrc.local

PS1='[\u@\h \W]\$ '
PS2='> '
PS3='> '
PS4='+ '

export PS1 PS2 PS3 PS4

if test "$TERM" = "xterm" -o \
        "$TERM" = "xterm-color" -o \
        "$TERM" = "xterm-256color" -o \
        "$TERM" = "rxvt" -o \
        "$TERM" = "rxvt-unicode" -o \
        "$TERM" = "xterm-xfree86"; then
    PROMPT_COMMAND="history -a"
    export PROMPT_COMMAND
fi

[ -r /etc/bash_completion   ] && . /etc/bash_completion
[ -r /etc/bash.bashrc.local ] && . /etc/bash.bashrc.local

using default .bashrc from /etc/skel

# Check for an interactive session
[ -z "$PS1" ] && return

alias ls='ls --color=auto'
PS1='[\u@\h \W]\$ '
#
# /etc/profile.bash
# Global settings for bash shells
#

#In the future we may want to add more ulimit entries here,
# in the offchance that /etc/security/limits.conf is skipped
ulimit -Sc 0 #Don't create core files

# Source our global bashrc file, to remove duplication of effort
[ -r /etc/bash.bashrc ] && . /etc/bash.bashrc

and for ~/.bash_profile

. $HOME/.bashrc

Offline

#11 2010-07-27 17:11:13

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: bash all messed up, wtf have I done?

Try running: bash -x

Offline

#12 2010-07-27 17:34:25

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: bash all messed up, wtf have I done?

bash_completion issues?

It's best to source the file you're tweaking after every modification, so you can catch any errors just after you've made them and not after you've added 100 lines to you .bashrc.

Google searches suggest sth wrong w/ permissions or PATH.

Offline

#13 2010-07-28 08:20:44

kennnn
Member
Registered: 2010-02-18
Posts: 14

Re: bash all messed up, wtf have I done?

Thanks karol,  falconindy and Procyon. smile

This was a very weird problem, for some unknown reason when I simply copied the vanilla .bashrc and .bash_profile from /etc/skel using thunar, the files didn't copy correctly. but did when I used cp.

It never affects any other copy and paste operations, (yet) so I not going to look into it just yet. Like karol said, I now believe it was down to permission problems, maybe I stupidly edited one of those two files as root, and saved.

learn from your mistakes hey.

Last edited by kennnn (2010-07-28 08:21:44)

Offline

#14 2010-07-28 11:46:25

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: bash all messed up, wtf have I done?

> It never affects any other copy and paste operations, (yet)
If I were you, I would make a note about that weird behavior. Next time it occurs you may go looking for hours for what the cause is.

Glad you got it working. Please mark the thread as solved.

Offline

Board footer

Powered by FluxBB