Re: Adding to the command line via variables

G_r_a_n_t__at_dodo.com.au
Date: 07/30/05

  • Next message: Bill Marcum: "Re: Adding to the command line via variables"
    Date: Sun, 31 Jul 2005 00:46:11 +1000
    
    

    On Sat, 30 Jul 2005 15:29:42 +0100, "John L" <jl@lammtarra.notthisbit.fslife.co.uk> wrote:
    >
    > "Jeff Kloek" <Jeff@Kloek.com> wrote in message news:DHLGe.42172$B52.25467@tornado.ohiordc.rr.com...
    > > Hello. I'm trying to figure out how I can build a command line using the
    > > output of the ls |grep command. The problem is the number of files returned
    > > will vary.
    > > As an example, one time might find output1, output2 and output3, and another
    > > time it might also include output4 and output5.
    > >
    > > How can I use the output of "ls |grep output" to build a command line that
    > > does the following:
    > > lp -d printername outputX outputX outputX ?
    > > I don't expect to ever exceed the allowable count of command line
    > > parameters.
    > > Any ideas would be greatly appreciated!!
    >
    > In general, you could use command substitution or xargs
    > but in this case, do you need the "ls |grep" at all?
    >
    > lp -d printername output*
    or:

      for x in some_pattern; do some_stuff_to $x; done

    Grant.


  • Next message: Bill Marcum: "Re: Adding to the command line via variables"

    Relevant Pages

    • Re: A lesson of the Civil War
      ... Thomas the most skilled battlefield ... With Grant in command of the Army of the Potomac ... Grant and Foote threw their forces into the Donelson and Henry fights, pushed hard, and won. ...
      (sci.military.naval)
    • Re: Solid performance by Sarah
      ... It was noted this morning that she said "McClellan" ... preceded Grant in the civil war, ... Grant never did command the Army of the Potomac as these others - including ... Meade retained that command under Grant. ...
      (soc.retirement)
    • RE: CLOSING Re: Obtaining complete Unix command line that evoked script as string
      ... To: Grant Jacobs; beginners perl ... Subject: Re: CLOSING Re: Obtaining complete Unix command line that evoked script as string ... Only shell that launched them is keeping track of the I/O ... parent process and passing STDOUT back to the parent process. ...
      (perl.beginners)
    • Re: A lesson of the Civil War
      ... Lee the most inspirational leader, Thomas the most skilled battlefield ... With Grant in command of the Army of the Potomac ...
      (sci.military.naval)
    • Re: A lesson of the Civil War
      ... Lee the most inspirational leader, Thomas the most skilled battlefield commander and Jackson the most Napoleanic, both in the good and bad sense. ... With Grant in command of the Army of the Potomac moved forward against Lee's Armyu of Northern Virgina and the army moved forward after battle rather than retiring to Washington to lick its wounds the way McCellan, Burnside, and Hooker had done. ...
      (sci.military.naval)