Hi, I have minGW, gawk (ver 3.1.5)
and i try to use grep at gawk program and get error
 
I have the file output.sas2
-------------------------------
1 2 3
AA
1 2 3
 
and bash script  "grepScript"
----------------------------
#!/bin/sh
grep_num_ops='grep -c 3 $1'
gawk --assign=num_ops=$grep_num_ops '{if ($0 == "AA") print num_ops; else print $0}' $1

when i use: "grepScript output.sas2" at the msys
i get msg: Usage: gawk ...

I expect to:
1 2 3
2
1 2 3

Thanks
Gilad

 
 
 


__________ Information from ESET NOD32 Antivirus, version of virus signature database 5263 (20100708) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com