473,326 Members | 2,102 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

'set' command gives garbage

256 100+
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
4 2275
Nepomuk
3,112 Expert 2GB
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
mac11
256 100+
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
3,112 Expert 2GB
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
mac11
256 100+
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

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

Similar topics

8
by: bearophileHUGS | last post by:
Hello, I have four things to ask or to suggest, sorry if they seem basic or already discussed. ------------------- I am still ignorant about Tkinter. This little program, after pressing the...
25
by: David Bernier | last post by:
I'd like to pass on the command line two filenames. As for example: my_executable filename_1 filename_2 I haven't done any C programming with command line arguments so far. I'm familiar...
40
by: aku | last post by:
I'm looking for the absolute fastest way to count the nr of bits that are set to "1" in a string. Presumably I then first need the fastest way to do this in a byte. I think this is it, but...
26
by: G Patel | last post by:
Hi, I'm wondering if anyone knows if the following function will function properly as a set-bit counter on non 2s complement machines (as K&R2 implies). | int bitcount(unsigned x) | { | ...
7
by: sathyashrayan | last post by:
Group, Following function will check weather a bit is set in the given variouble x. int bit_count(long x) { int n = 0; /* ** The loop will execute once for each bit of x set,
5
by: Greg | last post by:
Hi, I have been unable to resolve this error message: Object Ref not set to an instance of an object. The issue is that I cannot determine which object reference is causing the problem. ...
4
by: David Schwartz | last post by:
Seems that setting an object = Nothing no longer does anything in .NET. Garbage collection destroys the object eventually. So, does it ever make sense to set an object = Nothing in .NET? Thanks.
11
by: MikeT | last post by:
This may sound very elementary, but can you trap when your object is set to null within the object? I have created a class that registers an event from an object passed in the constructor. When...
2
by: Mick Duprez | last post by:
Hi All, I've installed Python 2.5 on a number of machines but on one I'm having problems with the CLI. If I fire up the 'cmd' dos box and type 'python' I get a line of gibberish and it locks up...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.