Re: an off topic question

From: Lew Pitcher (Lew.Pitcher_at_td.com)
Date: 10/30/03


Date: Thu, 30 Oct 2003 20:24:59 GMT

On Thu, 30 Oct 2003 20:10:43 -0000, "Darren" <foo.bar@world.com> wrote:

>Hi,
>
>VERY sorry to post here....
>
>but i am writing a batch file in windows using cygwin's grep, and need to
>know who to do:
>
>set var = grep NOTE *.txt
>
>in other words the VALUE of grep NOTE *.txt to be equal to the variable var.

This isn't very clear.

Do you mean that you want
a) the results of "grep NOTE *.txt" to be replaced by the value of $var?
   (that's the way your description reads to me)
b) $var to contain, as it's value, the string "grep NOTE *.txt"?, or
c) $var to contain, as it's value, the results of "grep NOTE *.txt"?

If you mean (a), then I can't help you

If you mean (b), then
  var="grep NOTE *.txt"
will do it

If you mean (c), then
  var=`grep NOTE *.txt`
will do it

If you mean something else, please explain.

[snip]

-- 
Lew Pitcher
IT Consultant, Enterprise Technology Solutions
Toronto Dominion Bank Financial Group
(Opinions expressed are my own, not my employers')


Relevant Pages

  • an off topic question
    ... but i am writing a batch file in windows using cygwin's grep, ... set var = grep NOTE *.txt ... in other words the VALUE of grep NOTE *.txt to be equal to the variable var. ...
    (comp.unix.shell)
  • Re: an off topic question
    ... > in other words the VALUE of grep NOTE *.txt to be equal to the variable var. ... Don't know about DOS, but with an sh-compatible shell you would do: ... For a POSIX compliant shell it could be: ...
    (comp.unix.shell)
  • Re: Find a line in a text file then print a field
    ... I had written a crude ksh script that grep'ed a line ... to do the same thing on Windows and perl seems like the right way to ... The perl grep function loops over list of strings you pass it. ...
    (perl.beginners)
  • Re: Flame Bait! Windows vs: The Unices
    ... >> consistancy of Windows (compared to UNIX) one of its strong points. ... But, in effect, Windows only runs on one platform,... ... Describing the *difference* between using grep in unix and using it ... just use an IDE and move on. ...
    (comp.programming)
  • Re: Data Mining for PIX Firewall Logs
    ... My response was not intended to imply that there was no other way to "grep" ... than with Cygwin. ... I am sure there is an open source grep for Windows. ... that tells me you are logging to a Windows machine. ...
    (Pen-Test)