Re: an off topic question

From: Alan Connor (zzzzzz_at_xxx.yyy)
Date: 10/30/03


Date: Thu, 30 Oct 2003 20:59:04 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.
>
> just in DOS this doesnt work!!
>
> ANY suggestions welcome (not TOOO rude pls)
>
> THANKS.....
>
> Darren
>
>
>
>

Don't know about DOS, but with an sh-compatible shell you would do:

var=`grep NOTE *.txt`

For a POSIX compliant shell it could be:

var=$(.....)

-- 
Alan C    this post ends with    w
                                 q


Relevant Pages

  • Re: GREP Unix command
    ... many standard UNIX comands for DOS. ... grep - regular expression search through files ... Regular expression pattern matching algorithm: ...
    (microsoft.public.windowsxp.general)
  • Re: IDEs
    ... attempt to provide implementations of all core UNIX programs ... This allows greater portability between UNIXes, ... For grep, I took the tcgrep program, created a DOS batch wrapper using ...
    (comp.lang.perl.misc)
  • Re: Extract Data With DOS
    ... I have a large file with millions of records and I have to clean it ... Can this be done in DOS? ... This is best handled with a 'grep' utility: ... grep -v ^XYZ oldfile> newfile ...
    (comp.os.msdos.programmer)
  • Re: an off topic question
    ... >but i am writing a batch file in windows using cygwin's grep, ... >in other words the VALUE of grep NOTE *.txt to be equal to the variable var. ...
    (comp.unix.shell)
  • 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)