'set' command gives garbage

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mac11
    Contributor
    • Apr 2007
    • 256

    'set' command gives garbage

    I'm having an issue where the output of the 'set' command gives me extra garbage and I'm wondering if anybody can help point me toward a solution. Actually, it looks like part of a script, not random garbage. Anyway, when I type set I get this output (shortened for brevity):
    Code:
    BASH=/bin/bash
    BASH_ARGC=()
    BASH_ARGV=()
    BASH_COMPLETION=/etc/bash_completion
    BASH_COMPLETION_DIR=/etc/bash_completion.d
    BASH_LINENO=()
    BASH_SOURCE=()
    ..... snip (it continues like normal for a while) ....
    .............
    .............
    WINDOWID=46137436
    WINDOWPATH=7:7:7:7
    XAUTHORITY=/home/user/.Xauthority
    XDG_DATA_DIRS=/usr/local/share/:/usr/share/:/usr/share/gdm/
    XDG_SESSION_COOKIE=3a7c2617118a89c0941a89564810cba3-1215613306.783332-151702627
    _=set
    bash205='3.2.33(1)-release'
    bash205b='3.2.33(1)-release'
    bash3='3.2.33(1)-release'
    _alias () 
    { 
        local cur;
        COMPREPLY=();
        cur=${COMP_WORDS[$COMP_CWORD]};
        case "$COMP_LINE" in 
            *[^=])
                COMPREPLY=($( compgen -A alias -S '=' -- $cur ))
            ;;
            *=)
                COMPREPLY=("$( alias ${cur%=} 2>/dev/null |                              sed -e 's|^alias '$cur'\(.*\)$|\1|' )")
            ;;
        esac
    }
    _apt_cache () 
    { 
        local cur prev special i;
        COMPREPLY=();
        cur=`_get_cword`;
        prev=${COMP_WORDS[COMP_CWORD-1]};
        if [ "$cur" != show ]; then
            for ((i=0; i < ${#COMP_WORDS[@]}-1; i++ ))
            do
                if [[ ${COMP_WORDS[i]} == @(add|depends|dotty|policy|rdepends|madison|show?(pkg|src|)) ]]; then
                    special=${COMP_WORDS[i]};
                fi;
            done;
        fi;
        if [ -n "$special" ]; then
    ..... snip (you get the point, it goes on and on with other stuff) .....
    .............
    .............
    So, any idea why I'm getting the script stuff as output from 'set'?

    If it helps, my linux at the moment is a vmware image of ubuntu 8.04 (using vmware player, not workstation or server).If you're interested, the image I'm using can be found at http://www.vmware.com/appliances/directory/1224
  • Nepomuk
    Recognized Expert Specialist
    • Aug 2007
    • 3111

    #2
    I don't know if this is still an issue, but if so, what is the exact command you're using, that gives you this output? I'm guessing it's not processing some file but printing it instead...

    Greetings,
    Nepomuk

    Comment

    • mac11
      Contributor
      • Apr 2007
      • 256

      #3
      Originally posted by Nepomuk
      I don't know if this is still an issue, but if so, what is the exact command you're using, that gives you this output? I'm guessing it's not processing some file but printing it instead...

      Greetings,
      Nepomuk
      Thanks Nepomuk, I forgot to check this thread for a long time, but it's still an annoyance.

      The command I run is just 'set' (hoping to just see a list of environment variables). I'm thinking maybe there is an error in some config file somewhere but I dont know enough about bash to know what's going on.

      any help is appreciated but it's not like I need to run 'set' very often so I can live with the strangeness.

      Comment

      • Nepomuk
        Recognized Expert Specialist
        • Aug 2007
        • 3111

        #4
        Originally posted by mac11
        Thanks Nepomuk, I forgot to check this thread for a long time, but it's still an annoyance.

        The command I run is just 'set' (hoping to just see a list of environment variables). I'm thinking maybe there is an error in some config file somewhere but I dont know enough about bash to know what's going on.

        any help is appreciated but it's not like I need to run 'set' very often so I can live with the strangeness.
        Hm, well I just checked and in my Ubuntu VM it's at least similar, if not the same. (Couldn't bother to check if all of the code was the same as yours.)

        Having a look at the output, the first (in my case 71) lines DO seem to be the environment variables, so in my case
        Code:
        set | head -n 71
        helps. Not ideal, I'll admit, but at least a solution.

        Greetings,
        Nepomuk

        Comment

        • mac11
          Contributor
          • Apr 2007
          • 256

          #5
          Thanks again, at least you've helped me confirm that it's not just some idiot thing I've done to cause this :)

          Comment

          Working...