Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] -bash: shopt: histappend: invalid shell option name
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
midway
Apprentice
Apprentice


Joined: 01 Jun 2012
Posts: 181
Location: somewhr in the blighty

PostPosted: Wed Aug 22, 2012 2:11 pm    Post subject: [solved] -bash: shopt: histappend: invalid shell option name Reply with quote

After updating my gentoo system root prompt looks like this:
Code:

-bash: shopt: histappend: invalid shell option name
\[\]SERVER\[\] ~ #\[\]


When i use the arrows of the keyboard, I get : ^[[D^ (looks like history file is not working?)
However, Only the root prompt has this problem.
How do I resolve this?
Code:


\[\]server\[\] ~ #\[\] bash -v
# /etc/bash/bashrc
#
# This file is sourced by all *interactive* bash shells on startup,
# including some apparently interactive shells such as scp and rcp
# that can't tolerate any output.  So make sure this doesn't display
# anything or bad things will happen !


# Test for an interactive shell.  There is no need to set anything
# past this point for scp and rcp, and it's important to refrain from
# outputting anything in those cases.
if [[ $- != *i* ]] ; then
        # Shell is non-interactive.  Be done now!
        return
fi

# Bash won't get SIGWINCH if another process is in the foreground.
# Enable checkwinsize so that bash will check the terminal size when
# it regains control.  #65623
# http://cnswww.cns.cwru.edu/~chet/bash/FAQ (E11)
shopt -s checkwinsize

# Enable history appending instead of overwriting.  #139609
shopt -s histappend
bash: shopt: histappend: invalid shell option name

# Change the window title of X terminals
case ${TERM} in
        xterm*|rxvt*|Eterm|aterm|kterm|gnome*|interix)
                PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\007"'
                ;;
        screen)
                PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\033\\"'
                ;;
esac

use_color=false

# Set colorful PS1 only on colorful terminals.
# dircolors --print-database uses its own built-in database
# instead of using /etc/DIR_COLORS.  Try to use the external file
# first to take advantage of user additions.  Use internal bash
# globbing instead of external grep binary.
safe_term=${TERM//[^[:alnum:]]/?}   # sanitize TERM
match_lhs=""
[[ -f ~/.dir_colors   ]] && match_lhs="${match_lhs}$(<~/.dir_colors)"
[[ -f /etc/DIR_COLORS ]] && match_lhs="${match_lhs}$(</etc/DIR_COLORS)"
</etc/DIR_COLORS)"
</etc/DIR_COLORS)
</etc/DIR_COLORS
[[ -z ${match_lhs}    ]] \
        && type -P dircolors >/dev/null \
        && match_lhs=$(dircolors --print-database)
[[ $'\n'${match_lhs} == *$'\n'"TERM "${safe_term}* ]] && use_color=true

if ${use_color} ; then
        # Enable colors for ls, etc.  Prefer ~/.dir_colors #64489
        if type -P dircolors >/dev/null ; then
                if [[ -f ~/.dir_colors ]] ; then
                        eval $(dircolors -b ~/.dir_colors)
                elif [[ -f /etc/DIR_COLORS ]] ; then
                        eval $(dircolors -b /etc/DIR_COLORS)
                fi
        fi

        if [[ ${EUID} == 0 ]] ; then
                PS1='\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
        else
                PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '
        fi

        alias ls='ls --color=auto'
        alias grep='grep --colour=auto'
else
        if [[ ${EUID} == 0 ]] ; then
                # show root@ when we don't have colors
                PS1='\u@\h \W \$ '
        else
                PS1='\u@\h \w \$ '
        fi
fi
dircolors -b /etc/DIR_COLORS)
dircolors -b /etc/DIR_COLORS
LS_COLORS='rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41;
export LS_COLORS

# Try to keep environment pollution down, EPA loves us.
unset use_color safe_term match_lhs
# /etc/skel/.bashrc
#
# This file is sourced by all *interactive* bash shells on startup,
# including some apparently interactive shells such as scp and rcp
# that can't tolerate any output.  So make sure this doesn't display
# anything or bad things will happen !


# Test for an interactive shell.  There is no need to set anything
# past this point for scp and rcp, and it's important to refrain from
# outputting anything in those cases.
if [[ $- != *i* ]] ; then
        # Shell is non-interactive.  Be done now!
        return
fi

# Put your fun stuff here. 
# Setup the path for ccache and distcc

[ -d /usr/lib/ccache/bin ] && PATH="/usr/lib/ccache/bin:$PATH"
[ -d /usr/lib/distcc/bin ] && PATH="/usr/lib/distcc/bin:$PATH"

# Add ~/bin/* to the current path.

if [ -d /opt/root/bin ]; then
  for d in `find /root/bin -type d` `find /opt/root/bin -type d` ; do
    PATH="$d:$PATH"
  done
  export PATH
fi

alias nano="nano -w"
alias rm="rm -i"

echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\007"



This is my /usr/portage/eclass/tests/eutils:eshopts.sh
Code:


#!/bin/bash

source tests-common.sh
inherit eutils
test-it() {
        local s0 s1 s2

        tbegin "push/pop '$*'"
        s0=$(shopt -p)
        t eshopts_push $*
        s1=$(shopt -p)
        t eshopts_pop
        s2=$(shopt -p)
        [[ ${s0} == "${s2}" ]] && \
        [[ ${s1} == *"shopt $*"* ]]
        tend $?
}

# should handle bug #395025
for arg in nullglob dotglob extglob ; do
        for flag in s u ; do
                test-it -${flag} ${arg}
        done
done
tbegin "multi push/pop"
s0=$(shopt -p)
t eshopts_push -s dotglob
t eshopts_push -u dotglob
t eshopts_push -s extglob
t eshopts_push -u dotglob
t eshopts_push -s dotglob
t eshopts_pop
t eshopts_pop
t eshopts_pop
t eshopts_pop
t eshopts_pop
s1=$(shopt -p)
[[ ${s0} == "${s1}" ]]
tend $?

texit


Last edited by midway on Thu Aug 23, 2012 9:46 am; edited 1 time in total
Back to top
View user's profile Send private message
midway
Apprentice
Apprentice


Joined: 01 Jun 2012
Posts: 181
Location: somewhr in the blighty

PostPosted: Thu Aug 23, 2012 9:22 am    Post subject: Reply with quote

bump....
Back to top
View user's profile Send private message
BrummBrumm
n00b
n00b


Joined: 04 Jan 2008
Posts: 58

PostPosted: Thu Aug 23, 2012 9:33 am    Post subject: Reply with quote

to me, it helped to re-emerge bash with the readline-useflag enabled.

Code:

echo "app-shells/bash readline" >> /etc/portage/package.use
emerge -1 bash
Back to top
View user's profile Send private message
midway
Apprentice
Apprentice


Joined: 01 Jun 2012
Posts: 181
Location: somewhr in the blighty

PostPosted: Thu Aug 23, 2012 9:45 am    Post subject: Reply with quote

BrummBrumm wrote:
to me, it helped to re-emerge bash with the readline-useflag enabled.

Code:

echo "app-shells/bash readline" >> /etc/portage/package.use
emerge -1 bash


Brilliant, here is the output:
Code:

make[1]: Leaving directory `/var/tmp/portage/app-shells/bash-4.2_p37/work/bash-4.2/po'
>>> Completed installing bash-4.2_p37 into /var/tmp/portage/app-shells/bash-4.2_p37/image/

strip: i686-pc-linux-gnu-strip --strip-unneeded -R .comment -R .GCC.command.line
   bin/bash
ecompressdir: bzip2 -9 /usr/share/man
ecompressdir: bzip2 -9 /usr/share/info

>>> Installing (1 of 1) app-shells/bash-4.2_p37
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

 * Regenerating GNU info directory index...
 * Processed 94 info files.
\[\]server\[\] ~ #\[\]


Then logging out and login again.
Server ~ #

Works like a charm. :-)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum