euglug.org

[작성자:] admin

  • [Eug-lug] Reading data to multiple variables



    Garl GrigsbyWed Jul 28 12:03:59 PDT 2004

    Bob Miller wrote:
    
    >This works for me...
    >
    >	while read line
    >	do
    >	    a=($line)
    >	    echo ${a[*]}
    >	    echo ${#a[*]}
    >	done < somefile
    >
    >  
    >
    Doesn't this result in all of the data being in a(1)? What I need is to 
    have the first number be in a(1), the first text in a(2), etc. What I am 
    trying to do is to check to see which of several USB harddrives is 
    installed. So I am parsing /proc/scsi/usb-storage*/* for (1) the GUID, 
    and (2) the whether that device is attached or not. So this is what it 
    looks like:
    
    grigsby at nfsets1 /proc/scsi/usb-storage-1 $ cat 3
       Host scsi3: usb-storage
           Vendor: Unknown
          Product: USB TO IDE
    Serial Number: None
         Protocol: Transparent SCSI
        Transport: Bulk
             GUID: 05e307020000000000000000
         Attached: Yes
    
    I am using the following to grab just the GUID and the Attached line:
    
    awk '/GUID/ {print $2} /Attached/ {print $2}` /proc/usb-storage-*/*
    
    This will return all of the GUIDs and whether each device is attached. I 
    just want to store this set of data in an array. Is that as clear as mud?
    
    Garl
    
  • [Eug-lug] The Apple Product Cycle



    Bob Miller & Anne Eagle (E-mail)Wed Jul 28 11:58:27 PDT 2004

    > An obscure component manufacturer somewhere in the Pacific Rim
    > announces a major order for some bleeding-edge piece of technology
    > that could conceivably become part of an expensive,
    > digital-lifestyle-enhancing nerd toy...
    
    Read the rest here.
    
        http://www.misterbg.org/AppleProductCycle/
    
    
    -- 
    Bob Miller                              K<bob>
    kbobsoft software consulting
    http://kbobsoft.com                     kbob at jogger-egg.com
    
  • [Eug-lug] Reading data to multiple variables



    Bob MillerWed Jul 28 11:47:53 PDT 2004

    Garl Grigsby wrote:
    
    >    I need a bit of bash help. I have a situation where I need to read 
    > two pieces of data from a text file and store these data into two 
    > variables. I know that this would be easy in perl, but I have to do this 
    > as a shell script. The data will be a number and a word, like this: 
    > "05e307020000000000000000 Yes".
    >    I know that I could simple get the data in two separate operations, 
    > but the problem is that there could be either 1, 2, 3, or 4 pairs of 
    > data, and while I could still do this will multiple steps, I would 
    > prefer to find a more elegant way. What I would really like to do would 
    > be to store this data in an array. The problem is that I cannot figure 
    > out how to store the data in the array.
    
    
    This works for me...
    
    	while read line
    	do
    	    a=($line)
    	    echo ${a[*]}
    	    echo ${#a[*]}
    	done < somefile
    
    -- 
    Bob Miller                              K<bob>
    kbobsoft software consulting
    http://kbobsoft.com                     kbob at jogger-egg.com
    
  • [Eug-lug] Reading data to multiple variables



    Allen BrownWed Jul 28 11:41:47 PDT 2004

    If you don't mind using the command line array, you can
    use set to do this.
      $ set - $(echo 05e307020000000000000000 Yes)
      $ echo $1
      05e307020000000000000000
      $ echo $2
      Yes
    
    Is this what you had in mind?
    -- 
    Allen Brown
      work: Agilent Technologies      non-work: http://www.peak.org/~abrown/
            allen_brown at agilent.com	            abrown at peak.org
      Socialism is like a dream. Sooner or later you wake up to reality. 
      --- Sir Winston Churchill
    
    Garl Grigsby wrote:
    > 
    >     I need a bit of bash help. I have a situation where I need to read
    > two pieces of data from a text file and store these data into two
    > variables. I know that this would be easy in perl, but I have to do this
    > as a shell script. The data will be a number and a word, like this:
    > "05e307020000000000000000 Yes".
    >     I know that I could simple get the data in two separate operations,
    > but the problem is that there could be either 1, 2, 3, or 4 pairs of
    > data, and while I could still do this will multiple steps, I would
    > prefer to find a more elegant way. What I would really like to do would
    > be to store this data in an array. The problem is that I cannot figure
    > out how to store the data in the array. I've tried something like this:
    > 
    >     myarray[*] = awk `my awk foo`
    > 
    > or this
    > 
    >     myarray[*] = awk `my awk foo`
    > 
    > but bash complains about a bad array subscript. So does anybody feel
    > like learning me some bash?
    > 
    > Thanks,
    > Garl
    > _______________________________________________
    > EUGLUG mailing list
    > euglug at euglug.org
    > http://www.euglug.org/mailman/listinfo/euglug
    
  • [Eug-lug] Reading data to multiple variables



    Garl GrigsbyWed Jul 28 11:33:26 PDT 2004

        I need a bit of bash help. I have a situation where I need to read 
    two pieces of data from a text file and store these data into two 
    variables. I know that this would be easy in perl, but I have to do this 
    as a shell script. The data will be a number and a word, like this: 
    "05e307020000000000000000 Yes".
        I know that I could simple get the data in two separate operations, 
    but the problem is that there could be either 1, 2, 3, or 4 pairs of 
    data, and while I could still do this will multiple steps, I would 
    prefer to find a more elegant way. What I would really like to do would 
    be to store this data in an array. The problem is that I cannot figure 
    out how to store the data in the array. I've tried something like this:
    
        myarray[*] = awk `my awk foo`
    
    or this
    
        myarray[*] = awk `my awk foo`
    
    but bash complains about a bad array subscript. So does anybody feel 
    like learning me some bash?
    
    Thanks,
    Garl
    
  • [Eug-lug] Netraverse Freebie



    Max LemieuxWed Jul 28 11:31:47 PDT 2004

    I'd be willing to give it a shot. I have a copy of Windows 2000 that should be 
    fun to get up and running under Win4Lin...
    
    If there are no objections, I'll contact Netraverse and obtain the goods... 
    Installation report to follow.
    
    Cheers,
    Max
    
    
    
    Bob Miller wrote:
    > Ralph recently told me that Netraverse has a free[beer] offer for
    > LUGs.  I'm personally not interested in Netraverse's software, as it
    > requires a Windows license, but if anyone here wants to pursue getting
    > this schwag for EUGLUG, go for it.
    > 
    > This page explains what it's all about.
    > 
    >     http://www.netraverse.com/LUG/
    > 
    
    
  • [Eug-lug] (no subject)



    Bob CrandellTue Jul 27 16:28:34 PDT 2004

    LINUX PIPELINE
    Date: Tue, 27 Jul 2004 23:28:34 +0000
    Message-ID: <20040727.YFN.84713000 at mail>
    MIME-Version: 1.0
    Content-Type: text/plain;
    	charset="iso-8859-1"
    Content-Transfer-Encoding: 8bit
    Content-Disposition: inline
    X-Mailer: AngleMail for phpGroupWare (http://www.phpgroupware.org) v 0.9.16.001
    
    Hi,
    
    Here it is again:
    
    -----------------------------------------
    
    1. EDITOR'S NOTE: SCO: Looking More Ridiculous Every Day
    
    Imagine if Darth Vader's secret identity had turned out to be
    Bozo the Clown. They would have been afraid Darth would blow up
    the whole galaxy, but instead the villain did pratfalls all
    around the Death Star control room, sending stacks of papers
    flying through the air, accidentally hitting himself in the face
    with a cream pie and squirting seltzer down his pants.
    
    That's how the SCO lawsuits against the Linux community are
    ending up. Until early this year, it was easy to envision SCO as
    a super-villain, threatening the Linux community with its deft
    gamesmanship and masterful legal maneuvers. Now, SCO is looking
    like a bunch of bumblers.
    
    A Michigan court recently dismissed most of SCO Group's lawsuit
    against DaimlerChrysler Corp.
    http://www.LinuxPipeline.com/showArticle.jhtml?articleId=23905085
    When the lawsuit was first filed, things looked pretty grim for
    DaimlerChrysler and, by extension, the entire Linux user community.
    
    But then a couple of things became apparent: first off, SCO
    wasn't suing about Linux, they were suing about Unix. The
    DaimlerChrysler action really had very little to do with the main
    conflict, which was SCO's attempting to prove that Linux
    contained SCO's proprietary Unix intellectual property.
    
    Worse for SCO: It later turned out that DaimlerChrysler wasn't
    even using SCO's products - hadn't been for seven years. Whoops!
    Ha ha!
    
    And SCO has also been targeted by a lawsuit from one of its
    biggest investors. BayStar was introduced to SCO by Microsoft
    last year, but the relationship quickly soured and, in a rare
    slap in the face, BayStar publicly demanded return of its
    investment in SCO.
    http://www.linuxpipeline.com/showArticle.jhtml?articleID=18901902
    BayStar later said SCO could keep its money, but only if SCO made
    changes in management and focused more on its lawsuit against IBM.
    http://www.linuxpipeline.com/showArticle.jhtml?articleID=18902808
    Another big investor, the Royal Bank of Canada, sold its shares to BayStar.
    http://www.linuxpipeline.com/showArticle.jhtml?articleID=20000263
    And SCO in June agreed to buy back BayStar's stake.
    http://www.linuxpipeline.com/showArticle.jhtml?articleID=21401109
    BayStar had a $40 million investment in SCO; SCO agreed to pay
    $13 million in cash plus several million shares of SCO common stock.
    
    BayStar sued on Friday, claiming SCO didn't live up to its end of
    the bargain. This was a few hours after SCO issued a press
    release saying the settlement was a done deal. BayStar claims SCO
    misled it on how much money could be made from SCO's intellectual
    property licensing, a claim that SCO denies.
    
    The outcome of the DaimlerChrysler lawsuit and the BayStar
    dispute leave SCO looking pretty foolish. But it's a mistake to
    think SCO is completely harmless. The company is still
    well-funded and its main lawsuits, against IBM, Novell and
    customer AutoZone, are still alive. Companies and users who
    depend on Linux should be sure they're comfortable with the legal
    ground they're standing on.
    
    The Linux community should by no means let down its guard against
    SCO. But a little pointing at SCO and laughing is certainly in order.
    
    Mitch Wagner
    mwagner at cmp.com
    Linux Pipeline
    http://www.LinuxPipeline.com
    
    2. TOP LINUX NEWS
    
    Jabber To Interoperate With SIMPLE
    http://www.LinuxPipeline.com/showArticle.jhtml?articleId=23904970
    The company plans to make its XMPP protocol communicate with
    IBM's version of SIMPLE.
    
    AMD's Opteron Gets Boost From Sun, Microsoft
    http://www.LinuxPipeline.com/showArticle.jhtml?articleId=25600461
    
    Versata Ships Time-Saving App Dev Tools For JBoss Server
    http://www.LinuxPipeline.com/showArticle.jhtml?articleId=25600222
    
    3. THE WEEK'S BEST STORIES
    
    SCO Lawsuit Against DaimlerChrysler Is Thrown Out
    http://www.LinuxPipeline.com/showArticle.jhtml?articleId=23905085
    Michigan judge's ruling is likely to discourage SCO from suing
    other Unix licensees that failed to certify their use of the
    operating system.
    
    BEA Systems Leads Linux Server Market
    http://www.LinuxPipeline.com/showArticle.jhtml?articleId=25600184
    IDC analyst Dennis Byron reports BEA held 25.2 percent of the
    North American market in 2003, compared with IBM's 11.5 percent
    in 2004.
    
    Open Source, Open Questions
    http://www.LinuxPipeline.com/showArticle.jhtml?articleId=23902487
    Features due in the next version of MySQL database could add to
    its momentum--or rob it of its simplicity.
    
    4. VOTING BOOTH: Cast Your Vote On User Interfaces
    http://linuxpipeline.com/vote/interface_040608.jhtml
    Best user interface: KDE, GNOME, Command line, other?
    
    -- THE RESULTS SO FAR --
    
    KDE: 56%, 700 votes out of 1249
    GNOME: 21%, 268 votes
    Command line: 15%, 184 votes
    Other: 8%, 97 votes
    -----------------------------------------
    
    --
    Assured Computing, Inc.
    When you need to be sure.
    http://www.assuredcomp.com/
    P.O. Box 40814
    Eugene, OR 97404
    Voice - 541-868-0331
    FAX - 541-463-1627
    
    
    
  • [Eug-lug] MyDoom is back.



    Jacob MeuserTue Jul 27 13:34:20 PDT 2004

    On Tue, Jul 27, 2004 at 12:10:36PM -0700, Ken Barber wrote:
    > On Monday 26 July 2004 10:29 pm, Bob Crandell wrote:
    > 
    > > SECURITY ALERT: MyDoom.m prevention and cure
    > >
    > > How to recognize: E-mail appears to be from your e-mail domain provider
    > > warning of a possible virus infection or spam abuse
    > 
    > I got a copy yesterday, if anyone wants to look at it.
    
    Just one?  I must have seen at least twenty already.
    
    -- 
    <jakemsr at jakemsr.com>
    
    
  • [Eug-lug] MyDoom is back.



    Ken BarberTue Jul 27 12:10:36 PDT 2004

    On Monday 26 July 2004 10:29 pm, Bob Crandell wrote:
    
    > SECURITY ALERT: MyDoom.m prevention and cure
    >
    > How to recognize: E-mail appears to be from your e-mail domain provider
    > warning of a possible virus infection or spam abuse
    
    I got a copy yesterday, if anyone wants to look at it.
    
    Ken
    
  • [Eug-lug] MyDoom is back.



    T. Joseph CARTERTue Jul 27 07:38:19 PDT 2004

    On Tue, Jul 27, 2004 at 01:58:27PM +0000, Bob Crandell wrote:
    > I suppose you've heard the next version of windows comes with airbags so, when
    > it crashes again, you won't hit your head.
    
    It came a little late to save the developers at Microsoft, apparently.