By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,799 Members | 1,334 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,799 IT Pros & Developers. It's quick & easy.

'set' command gives garbage

100+
P: 256
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):
Expand|Select|Wrap|Line Numbers
  1. BASH=/bin/bash
  2. BASH_ARGC=()
  3. BASH_ARGV=()
  4. BASH_COMPLETION=/etc/bash_completion
  5. BASH_COMPLETION_DIR=/etc/bash_completion.d
  6. BASH_LINENO=()
  7. BASH_SOURCE=()
  8. ..... snip (it continues like normal for a while) ....
  9. .............
  10. .............
  11. WINDOWID=46137436
  12. WINDOWPATH=7:7:7:7
  13. XAUTHORITY=/home/user/.Xauthority
  14. XDG_DATA_DIRS=/usr/local/share/:/usr/share/:/usr/share/gdm/
  15. XDG_SESSION_COOKIE=3a7c2617118a89c0941a89564810cba3-1215613306.783332-151702627
  16. _=set
  17. bash205='3.2.33(1)-release'
  18. bash205b='3.2.33(1)-release'
  19. bash3='3.2.33(1)-release'
  20. _alias () 
  21.     local cur;
  22.     COMPREPLY=();
  23.     cur=${COMP_WORDS[$COMP_CWORD]};
  24.     case "$COMP_LINE" in 
  25.         *[^=])
  26.             COMPREPLY=($( compgen -A alias -S '=' -- $cur ))
  27.         ;;
  28.         *=)
  29.             COMPREPLY=("$( alias ${cur%=} 2>/dev/null |                              sed -e 's|^alias '$cur'\(.*\)$|\1|' )")
  30.         ;;
  31.     esac
  32. }
  33. _apt_cache () 
  34.     local cur prev special i;
  35.     COMPREPLY=();
  36.     cur=`_get_cword`;
  37.     prev=${COMP_WORDS[COMP_CWORD-1]};
  38.     if [ "$cur" != show ]; then
  39.         for ((i=0; i < ${#COMP_WORDS[@]}-1; i++ ))
  40.         do
  41.             if [[ ${COMP_WORDS[i]} == @(add|depends|dotty|policy|rdepends|madison|show?(pkg|src|)) ]]; then
  42.                 special=${COMP_WORDS[i]};
  43.             fi;
  44.         done;
  45.     fi;
  46.     if [ -n "$special" ]; then
  47. ..... snip (you get the point, it goes on and on with other stuff) .....
  48. .............
  49. .............
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
Jul 17 '08 #1
Share this Question
Share on Google+
4 Replies

Nepomuk
Expert 2.5K+
P: 3,112
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
Aug 27 '08 #2

100+
P: 256
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.
Sep 8 '08 #3

Nepomuk
Expert 2.5K+
P: 3,112
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
Expand|Select|Wrap|Line Numbers
  1. set | head -n 71
helps. Not ideal, I'll admit, but at least a solution.

Greetings,
Nepomuk
Sep 9 '08 #4

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

Post your reply

Sign in to post your reply or Sign up for a free account.