473,405 Members | 2,300 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,405 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 2281
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.