euglug.org

[카테고리:] Uncategorized

  • [Eug-lug] simple script?



    Senior GoatSun Jun 20 20:11:57 PDT 2004

    Nice.  I know I've had trouble with arguments spreading out using $@, but I 
    must have used some intermediary to take apart the args.  I plugged it into 
    a test script and bash did things as expected.
    
    Anyway, URLs can have spaces in them, but they are converted to ascii by 
    http speakers.  For example, wget "http://a.com/a b c d.html" is very valid, 
    but will ask for, and probably save as a%20b%20c%20d%20.html.
    
    >From: Allen Brown <abrown at peak.org>
    >Reply-To: Eugene Unix and Gnu/Linux User Group <euglug at euglug.org>
    >To: Eugene Unix and Gnu/Linux User Group <euglug at euglug.org>
    >Subject: Re: [Eug-lug] simple script?
    >Date: Sun, 20 Jun 2004 19:46:03 -0700 (PDT)
    >
    >On Mon, 21 Jun 2004, Peter Bailey wrote:
    >
    > > Ha!  This is good.
    > >
    > > Unfortunately, I think they're all just a little broken.  First 
    off,
    > > if you  protect $@, things won't work right.  "$@" means 
    all
    > > arguments inclusive, so  all the arguments will be treated like
    > > one big one:
    > >
    > > wget "http://a.com http://b.com"
    >
    >Not correct.  "$@" is handled as a special case by the shell.  
    (True
    >for bash and ksh.)  Each element on the command line becomes one
    >element at the insertion point.
    >
    >What this means is that you can have strings with blanks in them if
    >they are quoted on the command line.
    >
    >In general "$@" is the Right Way to write scripts.  In this 
    case,
    >it probably doesn't matter since I don't think blanks are legal in
    >URLs.  But it is better to maintain good programming habits, so that
    >argues for using "$@" even where it is moot.
    >
    >So if you were to type
    >   $ myscript "a b" c
    >this would be equivalent to
    >   $ wget -r -l1 -nc --no-parent -A.pk3 "a b" c
    >
    > > This is not what you want.
    > >
    > > wget "http://a.com" "http://b.com"
    > >
    > > is what you want.  So, how to do that, or:
    > >
    > > wget "http://a.com"
    > > wget "http://b.com"
    > >
    > > and even
    > >
    > > wget "http://a.com/this is a link with spaces"
    > > wget "http://b.com"
    > >
    > > Try this one:
    > >
    > > while [ $# -ne 0 ]; do wget r -l1 -nc --no-parent -A.pk3 
    "${1}"; shift; done
    > >
    > >
    > > Keep in mind that this only takes arguments when protected by the 
    shell:
    > >
    > > ./myscript.sh "http://www.com/this is a link" 
    "http://a.com"
    > > "http://whatever.com/~!$ADSDF"
    > >
    > > and it will fail in the case of
    > > ./myscript.sh http://www.com/this is a link
    > >
    > > because it thinks of them all as individual arguments.
    > >
    > >
    > > Mr O wrote:
    > >
    > > >This what I have:
    > > >#!/bin/sh
    > > >wget -r -l1 -nc --no-parent -A.pk3
    > >
    > > This is what you want.
    > >
    > > #!/bin/sh
    > > wget -r -l1 -nc --no-parent -A.pk3 "$@"
    > >
    > > That will let you pull several sites in the same
    > > command.
    > >
    > >     ./myget.sh http://site1/foo http://site2/bar http://site3/baz
    > >
    > > If you're tired of typing "http://", you could do this 
    instead.
    > >
    > > #!/bin/sh
    > > wget -r -l1 -nc --no-parent -A.pk3 "http://$1"
    > >
    > >     ./myget.sh site1/foo
    > >     ./myget.sh site2/bar
    > >     ./myget.sh site3/baz
    >--
    >Allen Brown
    >   work: Agilent Technologies      non-work: 
    http://www.peak.org/~abrown/
    >         allen_brown at agilent.com	            abrown at peak.org
    >   The trouble with the rat race is that even if you win,
    >   you're still a rat. ---Lily Tomlin
    >
    >_______________________________________________
    >EUGLUG mailing list
    >euglug at euglug.org
    >http://www.euglug.org/mailman/listinfo/euglug
    
    _________________________________________________________________
    MSN Movies - Trailers, showtimes, DVD's, and the latest news from Hollywood! 
    http://movies.msn.click-url.com/go/onm00200509ave/direct/01/
    
    
  • [Eug-lug] simple script?



    Allen BrownSun Jun 20 19:46:03 PDT 2004

    On Mon, 21 Jun 2004, Peter Bailey wrote:
    
    > Ha!  This is good.
    > 
    > Unfortunately, I think they're all just a little broken.  First off,
    > if you  protect $@, things won't work right.  "$@" means all
    > arguments inclusive, so  all the arguments will be treated like
    > one big one:
    >
    > wget "http://a.com http://b.com"
    
    Not correct.  "$@" is handled as a special case by the shell.  (True
    for bash and ksh.)  Each element on the command line becomes one
    element at the insertion point.
    
    What this means is that you can have strings with blanks in them if
    they are quoted on the command line.
    
    In general "$@" is the Right Way to write scripts.  In this case,
    it probably doesn't matter since I don't think blanks are legal in
    URLs.  But it is better to maintain good programming habits, so that
    argues for using "$@" even where it is moot.
    
    So if you were to type
      $ myscript "a b" c
    this would be equivalent to
      $ wget -r -l1 -nc --no-parent -A.pk3 "a b" c
    
    > This is not what you want.
    > 
    > wget "http://a.com" "http://b.com"
    > 
    > is what you want.  So, how to do that, or:
    > 
    > wget "http://a.com"
    > wget "http://b.com"
    > 
    > and even
    > 
    > wget "http://a.com/this is a link with spaces"
    > wget "http://b.com"
    > 
    > Try this one:
    > 
    > while [ $# -ne 0 ]; do wget r -l1 -nc --no-parent -A.pk3 "${1}"; shift; done
    > 
    > 
    > Keep in mind that this only takes arguments when protected by the shell:
    > 
    > ./myscript.sh "http://www.com/this is a link" "http://a.com" 
    > "http://whatever.com/~!$ADSDF"
    > 
    > and it will fail in the case of
    > ./myscript.sh http://www.com/this is a link
    > 
    > because it thinks of them all as individual arguments.
    > 
    > 
    > Mr O wrote:
    > 
    > >This what I have:
    > >#!/bin/sh
    > >wget -r -l1 -nc --no-parent -A.pk3
    > 
    > This is what you want.
    > 
    > #!/bin/sh
    > wget -r -l1 -nc --no-parent -A.pk3 "$@"
    > 
    > That will let you pull several sites in the same
    > command.
    > 
    >     ./myget.sh http://site1/foo http://site2/bar http://site3/baz
    > 
    > If you're tired of typing "http://", you could do this instead.
    > 
    > #!/bin/sh
    > wget -r -l1 -nc --no-parent -A.pk3 "http://$1"
    > 
    >     ./myget.sh site1/foo
    >     ./myget.sh site2/bar
    >     ./myget.sh site3/baz
    --
    Allen Brown
      work: Agilent Technologies      non-work: http://www.peak.org/~abrown/
            allen_brown at agilent.com	            abrown at peak.org
      The trouble with the rat race is that even if you win,
      you're still a rat. ---Lily Tomlin
    
    
  • [Eug-lug] simple script?



    Peter BaileySun Jun 20 19:14:04 PDT 2004

    Ha!  This is good.
    
    Unfortunately, I think they're all just a little broken.  First off, if you 
    protect $@, things won't work right.  "$@" means all arguments inclusive, so 
    all the arguments will be treated like one big one:
    
    wget "http://a.com http://b.com"
    
    This is not what you want.
    
    wget "http://a.com" "http://b.com"
    
    is what you want.  So, how to do that, or:
    
    wget "http://a.com"
    wget "http://b.com"
    
    and even
    
    wget "http://a.com/this is a link with spaces"
    wget "http://b.com"
    
    Try this one:
    
    while [ $# -ne 0 ]; do wget r -l1 -nc --no-parent -A.pk3 "${1}"; shift; done
    
    
    Keep in mind that this only takes arguments when protected by the shell:
    
    ./myscript.sh "http://www.com/this is a link" "http://a.com" 
    "http://whatever.com/~!$ADSDF"
    
    and it will fail in the case of
    ./myscript.sh http://www.com/this is a link
    
    because it thinks of them all as individual arguments.
    
    
    Mr O wrote:
    
    >This what I have:
    >#!/bin/sh
    >wget -r -l1 -nc --no-parent -A.pk3
    
    This is what you want.
    
    #!/bin/sh
    wget -r -l1 -nc --no-parent -A.pk3 "$@"
    
    That will let you pull several sites in the same
    command.
    
        ./myget.sh http://site1/foo http://site2/bar http://site3/baz
    
    If you're tired of typing "http://", you could do this instead.
    
    #!/bin/sh
    wget -r -l1 -nc --no-parent -A.pk3 "http://$1"
    
        ./myget.sh site1/foo
        ./myget.sh site2/bar
        ./myget.sh site3/baz
    
    _________________________________________________________________
    FREE pop-up blocking with the new MSN Toolbar – get it now! 
    http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
    
    
  • [Eug-lug] simple script?



    Bob MillerSun Jun 20 18:52:57 PDT 2004

    Mr O wrote:
    
    > This what I have:
    > #!/bin/sh
    > wget -r -l1 -nc --no-parent -A.pk3 
    
    This is what you want.
    
    #!/bin/sh
    wget -r -l1 -nc --no-parent -A.pk3 "$@"
    
    That will let you pull several sites in the same
    command.
    
        ./myget.sh http://site1/foo http://site2/bar http://site3/baz
    
    If you're tired of typing "http://", you could do this instead.
    
    #!/bin/sh
    wget -r -l1 -nc --no-parent -A.pk3 "http://$1"
    
        ./myget.sh site1/foo
        ./myget.sh site2/bar
        ./myget.sh site3/baz
    
    -- 
    Bob Miller                              K<bob>
    kbobsoft software consulting
    http://kbobsoft.com                     kbob at jogger-egg.com
    
  • [Eug-lug] simple script?



    Cory PetkovsekSun Jun 20 16:55:32 PDT 2004

    On Sun, Jun 20, 2004 at 04:48:41PM -0700, Mr O wrote:
    > How do I add an argument to a simple shell script without fully
    > editing the script? I want to be able to connect to various
    > sites to pull down game maps and have the basic argument saved
    > and able to run but get an error saying no URL specified when
    > simply trying to append the site name on the command line.
    
    
    > #!/bin/sh
    > wget -r -l1 -nc --no-parent -A.pk3 $1
    
    shell arguments are $1, $2, $3.... $@ for all, $0 for program name  (ie
    ./myscript.sh if that is what you typed).
    
    Cory
    
    -- 
    Cory Petkovsek                                       Adapting Information
    Adaptable IT Consulting                                Technology to Your
    (858) 705-1655                                                   Business
    cory at AdaptableIT.com                                  www.AdaptableIT.com
    
  • [Eug-lug] simple script?



    Mr OSun Jun 20 16:48:41 PDT 2004

    How do I add an argument to a simple shell script without fully
    editing the script? I want to be able to connect to various
    sites to pull down game maps and have the basic argument saved
    and able to run but get an error saying no URL specified when
    simply trying to append the site name on the command line.
    
    This what I have:
    #!/bin/sh
    wget -r -l1 -nc --no-parent -A.pk3 
    
    For example I would type [./myget.sh sitename] to pull all the
    files.
    
    
    
    
    		
    __________________________________
    Do you Yahoo!?
    Yahoo! Mail - Helps protect you from nasty viruses.
    http://promotions.yahoo.com/new_mail
    
  • [Eug-lug] Mozilla 1.8a and Gentoo



    Mr OSun Jun 20 13:22:08 PDT 2004

    Anyone using Mozilla on Gentoo not built from source? Trying
    1.8a with mozilla-installer yeilds errors in regards to
    libnegotiateauth.so which turns up a few hits on google. Using
    the 1.8a mozilla-installer-bin tells me it can't open xpistub
    library.
    
    Upon trying to emerge Mozilla 1.7 it borked saying a machine
    error. In the meantime I'm emerging firefox (hopefully) and
    using Opera.
    
    Thanks for any clues,
    
    Mr O.
    
    
    		
    __________________________________
    Do you Yahoo!?
    New and Improved Yahoo! Mail - Send 10MB messages!
    http://promotions.yahoo.com/new_mail 
    
  • [Eug-lug] High speed internet



    JasonSun Jun 20 06:44:30 PDT 2004

    Ken:
    
    I've had cable for most of the last 6 years. I've had
    it for 10 months with Comcast in Eugene, and about
    another 3 years back east. I have had maybe one or two
    outages during this period, lasting a few hours both
    times.
    
    As someone mentioned, it's about $50/month, but the
    speed and reliability are good. Can't really comment
    on support - have only used it once or twice - but I'm
    assuming it's as bad as any other ISP I've dealt with
    (big or small).
    
    Jason
    
    --- Kenneth Silverman <hapilife at efn.org> wrote:
    > hey guys so i'm researching for high speed. what's
    > everybody using and 
    > how much? i'm looking for the best deal, of course,
    > and it'd be good if 
    > they'd host my website too. i'd like to think i'm
    > staying with efn but 
    > i'm not sure what to do so once my dues expire end
    > of sept then maybe 
    > i'm moving on....let me know.....ken
    > Ken Silverman		
    > 541 343 0912
    > hapilife at efn.org	
    > http://members.efn.org/~hapilife/
    > 
    > _______________________________________________
    > EUGLUG mailing list
    > euglug at euglug.org
    > http://www.euglug.org/mailman/listinfo/euglug
    > 
    
    
    
    		
    __________________________________
    Do you Yahoo!?
    New and Improved Yahoo! Mail - Send 10MB messages!
    http://promotions.yahoo.com/new_mail 
    
  • [Eug-lug] High speed internet



    Linux Rocks!Sun Jun 20 06:01:34 PDT 2004

    On Saturday 19 June 2004 07:14 pm, Kenneth Silverman wrote:
    : hey guys so i'm researching for high speed. what's everybody using and
    : how much? i'm looking for the best deal, of course, and it'd be good if
    : they'd host my website too. i'd like to think i'm staying with efn but
    : i'm not sure what to do so once my dues expire end of sept then maybe
    : i'm moving on....let me know.....ken
    
    Ken, Ive had both cable and DSL, and both have been a pain in the ass. Qwest 
    (or USWest back then) has a unique brand of frustations, and even if you use 
    a different ISP, it still goes back to qwest, so there is no escaping qwest 
    if you use DSL. 
    EFN used to offer 2 types of DSL and were even able to offer DSL to folks that 
    couldnt get DSL through qwest. I dont know what the currrent situation with 
    EFN's DSL customers... 
    Ive had cable in eugene, and in the dc area, and the only problem I had in 
    eugene (I only had it 1.5months) was the billing system. In the DC area it 
    worked great for about 3 months, then I started having problems, I think the 
    problems are gone, but it took months and about a dozen service calls.
    I wont even get started on the problems Ive had with qwest.
    
    Jamie
    
    : Ken Silverman
    : 541 343 0912
    : hapilife at efn.org
    : http://members.efn.org/~hapilife/
    :
    : _______________________________________________
    : EUGLUG mailing list
    : euglug at euglug.org
    : http://www.euglug.org/mailman/listinfo/euglug
    
    -- 
    I once witnessed a long-winded, month-long flamewar over the use of
    mice vs. trackballs... It was very silly.
    	-- Matt Welsh
    
    
  • [Eug-lug] High speed internet



    Mike McCoolSun Jun 20 01:56:07 PDT 2004

    Seems like efn was offering dsl hookup, weren't they?
    
    I checked the info at efn.org, but the faq really didn't say what the rates
    were.
    
    I thought it was some package through qwest (boo hiss) but at a bit under what
    bombast was charging for their cable-modem internet service.
    
    I've sent several emails to dsl at efn.org, but ain't heard nothin' back yet, so
    maybe this went away with the EPUD shift.
    
    Z ya,
    M
    
    On 19-Jun-04, Ken Barber wrote:
    >On Saturday 19 June 2004 4:14 pm, Kenneth Silverman wrote:
    >> hey guys so i'm researching for high speed. what's everybody using and
    >> how much?
    
    >I was in the same quandary a year ago.  I looked at all of the options that I
    
    >could find, including efn.
    
    >I wanted to stay away from comcast because of their business practices.  I 
    >also wanted to stay away from Qwest because of their massive incompetence.
    
    >I settled on DSL to PEAK (peak.org) in Corvallis.  Not as fast as cable, but
    I
    
    >get NO hassles from my ISP.  I pay Qwest for the DSL, but Peak is in charge 
    >of the DSLAM and they actually know what they're doing.
    
    >They were also the least amount of money (except the price for Qwest/MSN, 
    >which I wouldn't get if it were the last Internet connection on earth).
    
    
        http://world.lookscool.com
        http://www.efn.org/~mikemcoo