Berkeley CSUA MOTD:2000:November:26 Sunday <Saturday, Monday>
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2000/11/26-28 [Computer/SW/Unix, Computer/SW/Languages] UID:19911 Activity:moderate
11/25   #!/bin/sh
        : How do I make bourne shell subroutine modify a global variable?
        : Want to use VAR1 and VAR2 after the subroutine parses my_input_file
        foo() {
        while read VAR1 VAR2
        do
          echo "Reading $VAR1 and $VAR2"
          export VAR1 VAR2
        done < my_input_file
        export VAR1 VAR2
        }
        foo
        echo VARS = $VAR1 , $VAR2 # VAR1 & VAR2 are blank/empty-strings!
        \_ while loop is executed in a separate shell in bourne shell,
           thus its not possible.
           \_ wrong. but the order is backwards. Try this.
              #!/bin/sh
              export GLOBALVAR
              GLOBALVAR=1
              change(){
                GLOBALVAR=2
              }
              change
              echo $GLOBALVAR
                     \_ too complicted:
                           #!/bin/sh
                           change() {
                              GLOBAL=2;
                           }
                           GLOBAL=1;
                           echo GLOBAL is $GLOBAL
                           change
                           echo GLOBAL is $GLOBAL

                  \_ uh, no you are wrong. In *bourne* shell (virutally
                     unchanged since AT&T UNIX Version 7) while loops
                     are a separate process (I'm looking at the code
                     right now) when the input or output of the shell
                     is redirected. To avoid this you need to use exec
                     to save and restore STDIN. Try something like:
                     #!/bin/sh

                     myfunc () {
                       exec 5<&0 < "$1";
                       while read LINE ;
                       do
                          COUNT=`echo $COUNT + 1 | bc`
                       done
                       exec 0<&5 5<&-
                    }

                    COUNT=0
                    echo COUNT is $COUNT
                    myfunc /etc/passwd
                    echo COUNT is $COUNT
        \_ Get new shell.
           \_ Stick with Bourne shell as Steve and GOD intended.
2000/11/26-27 [Politics/Domestic/Crime, Reference/Military] UID:19912 Activity:insanely high
11/25   all you gun control people read this:
        http://jacksonville.com/tu-online/stories/112500/met_4711071.html
        \_ Actually, the number of incidents involving children shooting
           other children at school has been decreasing over the past several
           school.  really.  -tom
           years, and is never more than about half a dozen times a year.
           assailant was really necessary.  -tom
        \_ gee I'm sure the cases of kids shooting assailants far outweighs
           the cases of kids shooting themselves or shooting up their high
           school.  really.  And I'm also sure that killing the unarmed
           assailant was really necessary.  Actually it sounds like they
           shot him in the back as he was escaping.  -tom
           \_ If someone enters my property without my permission, he deserves
              to die.  It doesn't matter if he tries to flee or not.  It's a
              matter of principle.  Some people don't learn to respect property
              rights any other way.
                \_ Yeah!  But for me, if someone enters my property without
                   my permission.  I will first rape her before killing her.
                   That's my principle,  and you need to learn to respect
                   it.
           \_ Its called tresspassing, assault and attempted murder. The son
                         \_ No, it's called trespassing.
              killed a *CRIMINAL* in the act of committing a *CRIME*. He is
              the hero, he saved his father's life. Gun control would have
              resulted in two dead, the father and the son, while the scum
              who murdered them would be one the streets looking for his next
              victim (not that this would be a bad thing if his next victim
              was TOM).
                \_ Lack of gun control has resulted in documented cases of
                   thouands of innocent people being killed.  The idea of
                   private gun ownership stopping crime is simply too absurd
                   to respond to.  -tom
                   \_ And there are thousands of documented cases of innocent
                      people successfully defending themselves.  The idea of
                      private gun ownership not stopping crime is simply
                      too absurd to respond to.
                        \_ Add to the list of things NRA syncophants are too
                           cowardly to do: sign their names.  -tom
                           \_ Yeah, not signing means you're right and I'm
                              wrong.  Let's not bring those other unpleasant
                              things into this like the f-word: facts.  I like
                              how whenever certain people have nothing to say,
                              they always fall back on this "you're anonymous,
                              so your views don't count!" nonsense.
                                \_ not signing means you're too cowardly to
                                   stand behind your words.  -tom
                                   \_ I didn't write either of those posts,
                                      but I support the views expressed in
                                      them. I am not now, nor have I ever
                                      been a gun owner or a NRA member; one
                                      need not own a gun in order to understand
                                      that the RIGHT to keep and bear arms
                                      is fundamental to the preservation of
                                      freedom. ----ranga
                                      \_ Does England not have freedom?  -tom
                                         \_ If you want *that* sort of freedom,
                                            you're welcome to it.
        No, they don't.  The UK has the highest per-capita number of _/
        CCTV cameras in the world.  There is no equivalent of the bill
        of rights, no habeas corpus, and numerous anti-terrorism laws
        which permit massive governmental intrusion into what you and I
        view as fundamental individual liberties.  Guns are banned
        completely, with very few specific exceptions.  And yet, the UK
        has a higher rate of crimes against property and many violent
        crimes than the US.  No, not what I see as "free".  -John
        \_ Garbage! Habeas corpus ORIGINATED in England by MEDIEVAL times.
           You are a joke!
          \_ As did the concept of a written document fundamentally
             delineating the powers and responsibilities of rulers towards
             their subjects, as a form of contractual terms of office.
             That doesn't mean they have one at present... -John
                                         \_ England does not have freedom, Tom.
                                            Recently England jailed a man for
                                            killing a burglar.
                                                \_ ah, so "freedom" includes
                                                   "freedom to murder". -tom
                                                   \_ We call it self defense.
                                                      I suggest that you should
                                                      be imprisoned and retrained
                                                      for assaulting that poor
                                                      guy at the ATM who only
                                                      wanted you to share your
                                                      wealth.
                                         \_ I don't know, but England did
                                            abolish slavery in the 1830s.
                                            \_ Hello?  Modern times?  England
                                               still had colonies until the
                                               middle of the 20th century, too.
                                               What's either have to do with
                                               modern England?  You're right.
                                               You _don't_ know.
                \_ Well ya know what they say... a Republican is a Democrat
                   that's been mugged.  I'm sure Tom will be thrilled to know
                   the cops will show up 90 minutes later to take a report
                   after some garbage busts into his house, robs the place,
                   and beats the shit out of him.  Another favorite is "a
                   young man that isn't liberal has no heart, a grown man
                   that isn't conservative is a fool".
                        \_ oh incidentally; I was mugged once, at an ATM in
                           San Bruno, and fought the guy off.  If either of us
                           had had a gun I might have been shot.  -tom
                        \_ I was mugged and am still a liberal. Also, it is
                           "old man" not "grown man" in your quote. -ausman
                                \_ it's also "has no brain" rather than "is
                                   a fool".  -tom
                                   \_ Well, what can you expect from someone
                                      with no brain.
                           \_ Ok, so how exactly would strict guns laws that
                              keep citizens from arming themselves have kept
                              your attacker from being armed?  Law don't keep
                              anyone from doing anything.  They provide a post-
                              facto punishment.  If he was willing to assault
                              and rob you, he's already not concerned with
                              post-crime punishment.  And while we're at it,
                              if you'd had a weapon, you could have apprehended
                              the criminal so he wouldn't turn on some other
                              person less able to physically defend themselves.
                              Thank you for making the streets more dangerous
                              by teaching a criminal how to better choose his
                              victims.
                                \_ Garbage!  Gun laws are not for keeping
                                   law-abiding citizens from owning guns.
                                   \_ What?  Are you nuts?  Who are they written
                                      to keep guns from then?  Are you talking
                                      about the U.S. or somewhere else?  Of
                                      *course* gun laws are written to keep
                                      law abiding citizens from having guns.
                                      --not NRA member or gun owner but awake
                                      \_ They are written to keep them from
                                         people who want to own guns but
                                         can't or do not want to handle
                                         the responsibilities that goes with
                                         it.
        \_ Here's a funny cartoon on the subject:
           http://www.penny-arcade.com/view.php3?date=2000-10-09&res=l
2000/11/26-28 [Politics/Domestic/President/Clinton, Recreation/Media] UID:19913 Activity:moderate
11/25   perl -i -ep "AnyGivenSunday--OliverStone" s/football stars/programmers/g
        and the movie would still be valid. - comments?
        \_ Whatever.
        \_ That movie sucked really poorly. Oliver Stone is one of the worst
           directors in the history of movies.  The movie certainly could not
           have been worse, whether it was about programmers or even executive
           assistants.
                \_ Any movie that has eyeballs flying all over the place
                   is pretty cool.  It could have done without the sausage
                   action, though.  -John
           \_ Oliver Stone's next movie is going to be a hit: Oliver Stone's
              Bill Clinton, staring Richard Gere as Bill, Annette Benning as
              Hillary Clinton, Tori Spelling as Monica, Brent Spiner as Al
              Gore, Patricia Ruttledge as Madaline Albright, Judi Dench as
              Janet Reno. Open parts include: Tipper Gore, Ken Star, Newt,
              and First Dyke Chelsea.
              \_ John Goodman as Newt, Don Knotts as Ken Starr, Meredith
                 Baxter Birney as Tipper and Melissa Joan Hart as Chelsea
                 \_ John Goodman's too tall for Newt. Rush Limbaugh maybe
                    but not Newt.
                    MJH is too attractive to be Chelsea, need someone uglier,
                    like that chick on Boy Meets World.
                    Don Knotts as Ken Starr, that's pretty funny, though
                    it might be too funny. Need someone really stiff.
                    Now who would you get for Joycellen Elders? Mrs. Cosby?
                    How about Clarence Thomas?
2000/11/26-29 [Academia/Berkeley/CSUA] UID:19914 Activity:nil
11/21   CSUA POLITBURO ELECTIONS will be held at the next GENERAL MEETING.
                 Tuesday, Dec 5th.   6:00pm.   337 Soda Hall.
        ---++--- Save the CSUA! Make your voice heard! VOTE! ---++---
2000/11/26-2001/2/2 [Academia/Berkeley/CSUA] UID:19915 Activity:nil 66%like:19790
**/**   Politburo Meetings 6-7pm, 1st & 3rd Tuesdays, 337 Soda Hall
2000/11/26-29 [Computer/SW/Editors/Vi] UID:19916 Activity:nil
**/**   Welcome to Soda Mark VI.  Things may work differently now.  Deal.
               This computer, an Athlon/700, was donated by AMD.
2000/11/26-29 [Uncategorized] UID:19917 Activity:nil 63%like:19880
11/21   There will be a new office combination on Monday Nov 27th.
        Email librarian@csua if you think that you need the combo.
2000/11/26 [Uncategorized] UID:19918 Activity:nil 80%like:19532
>4/240  April never ended.
        \_ Does that mean no more birthdays?  Do we all stop aging?
Berkeley CSUA MOTD:2000:November:26 Sunday <Saturday, Monday>