euglug.org

[작성자:] admin

  • [Eug-lug] Shell scripting IFS woes



    Fred JamesTue Nov 15 08:50:47 PST 2005

    Neil Parker wrote:
    
    >Patrick Wade wrote,
    >  
    >
    >>My problem ; i have a file containing a list of filenames, which may 
    >>contain spaces or dots in them:
    >>---
    >>foo
    >>bar baz
    >>quux.random
    >>---
    >>I would like to execute a series of scp commands on them:
    >>---
    >>scp me at there:foo here/
    >>scp "me at there:bar baz" here/
    >>scp me at there:quux.random here/
    >>---
    >>My various efforts at IFS definition have not done what i wanted.
    >>Can anyone point me towards the right way to do this?
    >>    
    >>
    >
    >Forget IFS--xargs can do you work for you, and in just one command line:
    >
    >     xargs -i scp 'me at there:{}' here/ <list-of-files
    >
    >(where "list-of-files" is your file containing the list of filenames).
    >
    >               - Neil Parker
    >  
    >
    Neil Parker
    I was able to get satisfactory results from this one by added \" in four 
    places (see below) - granted my testing was all local.  Does it behave 
    differently when copying from remote?
    Regards
    Fred James
    
    #! /bin/sh
    #       fubar3.sh
    #
    fileName="fubar"
    xargs -i scp \"'{}'\" \"'{}'\".new < $fileName
    exit
    
    
  • [Eug-lug] Shell scripting IFS woes



    Fred JamesTue Nov 15 08:44:36 PST 2005

    Bob Miller wrote:
    
    >Patrick R. Wade wrote:
    >
    >  
    >
    >>My problem ; i have a file containing a list of filenames, which may 
    >>contain spaces or dots in them:
    >>---
    >>foo
    >>bar baz
    >>quux.random
    >>---
    >>I would like to execute a series of scp commands on them:
    >>---
    >>scp me at there:foo here/
    >>scp "me at there:bar baz" here/
    >>scp me at there:quux.random here/
    >>---
    >>    
    >>
    >
    >    #!/bin/sh
    >
    >    while IFS="
    >    " read word
    >    do
    >	echo scp ">>>me at there:$word<<<" here/
    >    done <<EOF
    >    foo
    >    bar baz
    >    quux.random
    >    EOF
    >
    >Up at the top it reads ... I F S = " \n " ...  And the >>> <<< are
    >just showing where that particular arg starts and stops.
    >
    >  
    >
    Bob Miller
    I was able to get this one to work by removing the 'echo', and adding \" 
    in four places (see below) - granted my testing was all local.  Does it 
    behave differently copying from remote?
    Regards
    Fred James
    
    #!/bin/sh
    #
    while IFS="
    " read word
    do
            scp "\"$word\"" ./\""$word\"".new
    foo
    bar baz
    quux.random
    EOF
    
    
  • [Eug-lug] An account of the War on Terror, as rendered via the Unix command-line:



    Bob MillerTue Nov 15 07:54:54 PST 2005

    Edward Craig wrote:
    
    > Farc as I can tell, accordintg to the mass media, if you don't call yourself
    > neo-liberal or neo-conservative, you are either anarchist or fascist (or
    > somehow both). I dunno why that neo prefix is necessary.
    
    "Neo" means "immune to kneejerk arguments against my ideology."  We
    should all be neo-whatever, because kneejerk arguments are never
    pretty.
    
    Me, I'm a neo-desktop-linucist.
    
    -- 
    Bob Miller                              K<bob>
                                            kbob at jogger-egg.com
    
  • [Eug-lug] An account of the War on Terror, as rendered via the Unix command-line:



    Edward CraigTue Nov 15 03:15:24 PST 2005

    Farc as I can tell, accordintg to the mass media, if you don't call yourself
    neo-liberal or neo-conservative, you are either anarchist or fascist (or
    somehow both). I dunno why that neo prefix is necessary.
    
    On 11/15/05, T. Joseph CARTER <knghtbrd at bluecherry.net> wrote:
    >
    > On Mon, Nov 14, 2005 at 06:46:07PM -0800, dooger watts wrote:
    > > This is fabulous. I'm forwarding it to all my 'droid friends. And
    > > speak of it, ARE there any consevative nerds/geeks? Seems like that's
    > > almost a contradiction in terms.
    >
    > I used to describe myself as quite liberal. By Eugene standards I'm a
    > fascist, but that's true of anybody who isn't to the left of Ted Kennedy.
    >
    > --
    > "We are what we repeatedly do. Excellence, therefore, is not an act,
    > but a habit."
    > -- Aristotle
    > _______________________________________________
    > EUGLUG mailing list
    > euglug at euglug.org
    > http://www.euglug.org/mailman/listinfo/euglug
    >
    
    
    
    --
    Edward P. Craig
    "Think this through with me. Let me know your mind" Hunter/Garcia
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://www.euglug.org/pipermail/euglug/attachments/20051115/c808d9f0/attachment.htm
    
  • [Eug-lug] An account of the War on Terror, as rendered via the Unix command-line:



    T. Joseph CARTERTue Nov 15 00:37:06 PST 2005

    On Mon, Nov 14, 2005 at 06:46:07PM -0800, dooger watts wrote:
    > This is fabulous.  I'm forwarding it to all my 'droid friends.   And 
    > speak of it, ARE there any consevative nerds/geeks?  Seems like that's 
    > almost a contradiction in terms. 
    
    I used to describe myself as quite liberal.  By Eugene standards I'm a
    fascist, but that's true of anybody who isn't to the left of Ted Kennedy.
    
    -- 
    "We are what we repeatedly do.  Excellence, therefore, is not an act,
    but a habit."
    	-- Aristotle
    
  • [Eug-lug] An account of the War on Terror, as rendered via theUnix command-line:



    larry priceMon Nov 14 23:55:07 PST 2005

    On 11/14/05, Patrick R. Wade <prwade at oip.net> wrote:
    > larry price wrote:
    > > politics is out of place on the euglug list, and at euglug events.
    > >
    > > If you want to talk politics, start a blog.
    > >
    >
    > Did we lose the activism list in the Great Migration?
    
    Activism at euglug.org is still there,
    but has little traffic
    8 posts from 2 addresses (me and kbob) over the past year.
    
    
    --
    http://Zoneverte.org -- information explained
    Do you know what your IT infrastructure does?
    
  • [Eug-lug] An account of the War on Terror, as rendered via theUnix command-line:



    Patrick R. WadeMon Nov 14 23:48:06 PST 2005

    larry price wrote:
    > politics is out of place on the euglug list, and at euglug events.
    > 
    > If you want to talk politics, start a blog.
    > 
    
    Did we lose the activism list in the Great Migration?
    
  • [Eug-lug] An account of the War on Terror, as rendered via theUnix command-line:



    larry priceMon Nov 14 23:47:07 PST 2005

    politics is out of place on the euglug list, and at euglug events.
    
    If you want to talk politics, start a blog.
    
    mine's at http://zoneverte.blogspot.com/
    prepare to be offended ;-)
    
    On 11/14/05, Jim K <kjim9 at cmc.net> wrote:
    >    There  are still some conservative types I think on the mailing list, but
    > few bother to come to the meetings often, because of the off linux political
    > stuff is very one sided.
    > Jim K
    > ----- Original Message -----
    > From: "Patrick R. Wade" <prwade at oip.net>
    > To: "Eugene Unix and Gnu/Linux User Group" <euglug at euglug.org>
    > Sent: Tuesday, November 15, 2005 4:10 AM
    > Subject: Re: [Eug-lug] An account of the War on Terror, as rendered via
    > theUnix command-line:
    >
    >
    > > dooger watts wrote:
    > > >   And
    > > > speak of it, ARE there any consevative nerds/geeks?
    > >
    > > There have been several on this list ; last i heard the ones i knew were
    > > turned off by the political tone of the list.
    > > _______________________________________________
    > > EUGLUG mailing list
    > > euglug at euglug.org
    > > http://www.euglug.org/mailman/listinfo/euglug
    > >
    > >
    > > --
    > > No virus found in this incoming message.
    > > Checked by AVG Free Edition.
    > > Version: 7.1.362 / Virus Database: 267.13.0/168 - Release Date: 11/14/05
    > >
    > >
    >
    > _______________________________________________
    > EUGLUG mailing list
    > euglug at euglug.org
    > http://www.euglug.org/mailman/listinfo/euglug
    >
    
    
    --
    http://Zoneverte.org -- information explained
    Do you know what your IT infrastructure does?
    
  • [Eug-lug] Shell scripting IFS woes



    Neil ParkerMon Nov 14 22:01:58 PST 2005

    Patrick Wade wrote,
    >My problem ; i have a file containing a list of filenames, which may 
    >contain spaces or dots in them:
    >---
    >foo
    >bar baz
    >quux.random
    >---
    >I would like to execute a series of scp commands on them:
    >---
    >scp me at there:foo here/
    >scp "me at there:bar baz" here/
    >scp me at there:quux.random here/
    >---
    >My various efforts at IFS definition have not done what i wanted.
    >Can anyone point me towards the right way to do this?
    
    Forget IFS--xargs can do you work for you, and in just one command line:
    
         xargs -i scp 'me at there:{}' here/ <list-of-files
    
    (where "list-of-files" is your file containing the list of filenames).
    
                   - Neil Parker
    
  • [Eug-lug] Shell scripting IFS woes



    Patrick R. WadeMon Nov 14 21:29:39 PST 2005

    Bob Miller wrote:
    
    > 
    >     #!/bin/sh
    > 
    >     while IFS="
    >     " read word
    >     do
    > 	echo scp ">>>me at there:$word<<<" here/
    >     done <<EOF
    >     foo
    >     bar baz
    >     quux.random
    >     EOF
    > 
    > Up at the top it reads ... I F S = " \n " ...  And the >>> <<< are
    > just showing where that particular arg starts and stops.
    > 
    Thanks ; i think this is doing what i want.