I am trying to get output from grep with wildcard
proc = subprocess.Popen(['grep', '002HQV', 'test.*'], stdout=subprocess.PIPE,
shell=True)
res = proc.stdout.readlines()
print(res)
but get the following error
2.4.3 (#1, Jun 11 2009, 14:09:37)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)]
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
[]
Is it wrong with my grep syntax?
The following works
proc = subprocess.Popen(['ls', '*'], stdout = subprocess.PIPE, shell=True)
and
os.system("grep 02HQV test.*")