Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have Kali8 installed - it is a Debian/GNU Linux ("wheezy") based distro - and when I use the Bash built-in command "set" to check my vars from X, like in LXterminal, everything works fine, but when I do it from either the console VT or SSH/Putty log-in, I get some vars and then a bunch of lines of code - thousands of lines that look like from some kind of completion script.

The other thing is that, it seems to me, that the list was shorter few weeks ago when the system was freshly installed and the lines are getting cumulatively more numerous, so the list get longer as time passes. The list always has the actual variables that should be there at the beginning and the same lines of code at the end, so I assume the added lines are in the middle. To verify this last one, i am going to pipe the list to a file and then do it again in few days and see if the size get larger.

Anyway, does anybody know why or how to fix the fact that is printing thousands of line of unknown script code?

Here is an example:


root@kali:~# set
BASH=/bin/bash
BASHOPTS=checkwinsize:cmdhist:expand_aliases:extglob:extquote:force_fignore:interactive_comments:$
BASH_ALIASES=()
BASH_ARGC=()
BASH_ARGV=()
BASH_CMDS=()
BASH_COMPLETION_COMPAT_DIR=/etc/bash_completion.d
BASH_LINENO=()
BASH_SOURCE=()
BASH_VERSINFO=([0]="4" [1]="2" [2]="37" [3]="1" [4]="release" [5]="x86_64-pc-linux-gnu")
BASH_VERSION='4.2.37(1)-release'
COLUMNS=80
COMP_WORDBREAKS=$' \t\n"\'>=;|&(:'
DIRSTACK=()
EUID=0
GROUPS=()
HISTFILE=/root/.bash_history
HISTFILESIZE=500
HISTSIZE=500
HOSTNAME=kali
HOSTTYPE=x86_64
IFS=$' \t\n'
LANG=en_US.UTF-8
LIBGL_DRIVERS_PATH=/usr/lib32/dri:/usr/lib64/dri
LINES=24
LOGNAME=root
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=40;$
LS_OPTIONS='--color=auto -F'
MACHTYPE=x86_64-pc-linux-gnu
MAIL=/var/mail/root
MAILCHECK=60
OPTERR=1
OPTIND=1
OSTYPE=linux-gnu
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PIPESTATUS=([0]="1" [1]="0")
PPID=10987
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
PS4='+ '
PWD=/root
SHELL=/bin/bash
SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor
SHLVL=1
SSH_CLIENT='192.168.10.143 10827 22'
SSH_CONNECTION='192.168.10.143 10827 192.168.10.104 22'
SSH_TTY=/dev/pts/1
TERM=xterm
UID=0
USER=root
XDG_SESSION_COOKIE=fb89d5d02d263ebdcf49f3a551dccb8b-1374307938.708154-385548377
_=
__colormgr_commandlist=$'\n    create-device\n    create-profile\n    delete-device\n    delete-p$
__git_all_commands=
__git_diff_common_options=$'--stat --numstat --shortstat --summary\n\t\t\t--patch-with-stat --nam$
__git_fetch_options=$'\n\t--quiet --verbose --append --upload-pack --force --keep --depth=\n\t--t$
__git_log_common_options=$'\n\t--not --all\n\t--branches --tags --remotes\n\t--first-parent --mer$
__git_log_date_formats='relative iso8601 rfc2822 short local default raw'
__git_log_pretty_formats='oneline short medium full fuller email raw format:'
__git_log_shortlog_options=$'\n\t--author= --committer= --grep=\n\t--all-match\n'
__git_merge_options=$'\n\t--no-commit --no-stat --log --no-log --squash --strategy\n\t--commit --$
__git_merge_strategies=
__git_mergetools_common=$'diffuse ecmerge emerge kdiff3 meld opendiff\n\t\t\ttkdiff vimdiff gvimd$
__git_porcelain_commands=
__git_send_email_confirm_options='always never auto cc compose'
__git_send_email_suppresscc_options='author self cc bodycc sob cccmd body all'
__git_whitespacelist='nowarn warn error error-all fix'
__grub_script_check_program=grub-script-check
_backup_glob='@(#*#|*@(~|.@(bak|orig|rej|swp|dpkg*|rpm@(orig|new|save))))'
_xspecs=([freeamp]="!*.@(mp3|ogg|pls|m3u)" [cdiff]="!*.@(dif?(f)|?(d)patch)?(.@([gx]z|bz2|lzma))"$
__colormgrcomp ()
{
    local all c s='
' IFS=' ''      ''
';
    local cur="${COMP_WORDS[COMP_CWORD]}";
    if [ $# -gt 2 ]; then
    fi;
    for c in $1;
    do
        case "$c$4" in
            *.)
                all="$all$c$4$s"
            ;;
            *)
                all="$all$c$4 $s"
            ;;
        esac;
    done;
    IFS=$s;
    COMPREPLY=($(compgen -P "$2" -W "$all" -- "$cur"));
    return
}
__dconf ()
{
    local choices;
...

********... thousands of lins after... **********
...
{
    local userland=$( uname -s );
    [[ $userland == @(Linux|GNU/*) ]] && userland=GNU;
    [[ $userland == $1 ]]
}
_variables ()
{
    if [[ $cur =~ ^(\$\{?)([A-Za-z0-9_]*)$ ]]; then
        [[ $cur == *{* ]] && local suffix=} || local suffix=;
        COMPREPLY+=($( compgen -P ${BASH_REMATCH[1]} -S "$suffix" -v --             "${BASH_REMAT$
        return 0;
    fi;
    return 1
}
_xfunc ()
{
    set -- "$@";
    local srcfile=$1;
    shift;
    declare -F $1 &>/dev/null || {
        local compdir=./completions;
        [[ $BASH_SOURCE == */* ]] && compdir="${BASH_SOURCE%/*}/completions";
        . "$compdir/$srcfile"
    };
    "$@"
}
_xinetd_services ()
{
    local xinetddir=/etc/xinetd.d;
    if [[ -d $xinetddir ]]; then
        local restore_nullglob=$(shopt -p nullglob);
        shopt -s nullglob;
        local -a svcs=($( printf '%s\n' $xinetddir/!($_backup_glob) ));
        $restore_nullglob;
        COMPREPLY+=($( compgen -W '${svcs[@]#$xinetddir/}' -- "$cur" ));
    fi
}
quote ()
{
    local quoted=${1//\'/\'\\\'\'};
    printf "'%s'" "$quoted"
}
quote_readline ()
{
    local quoted;
    _quote_readline_by_ref "$1" ret;
    printf %s "$ret"
}


root@kali:~#

P.S.: on a side note and probably unreleted subject the line above it should have been COMP_WORDBREAKS=$' \t\n"\'><=;|&(:', but I had to remove the < from it, because it seems to mess-up with StackExchange MarkDown and HTML... if I enter this complete line to the line above, it actually shows up as /dev/null after the > and it will impede most of the remaining lines after it from showing on my post... mhmm... strange.

share|improve this question

1 Answer 1

The defined functions are used by bash completion. In Debian, the file /etc/bash_completion is sourced, which then sources all the files in /etc/bash_completion.d. Some command line applications install new completion files. A good example is git in your output. It allows you to tab complete things like git che[TAB] to get git checkout. If you don't want the advanced completion, just remove the . /etc/bash_completion from you shell initialization files.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.