I have this script I'm trying to get working:
Code:
#!/usr/bin/python
import os
code = os.system("egrep --exclude=searchresults.txt --exclude=*.{html,py*} '(word1.*word2)|(word2.*word1)' * > '/home/david/folder/searchresults.txt'")
when I copy this portion:
Code:
egrep --exclude=searchresults.txt --exclude=*.{html,py*} '(word1.*word2)|(word2.*word1)' *
and paste it into the terminal at the proper directory, it lists out the results properly, but when I run the whole python script (or paste the entire thing into the terminal) I get extra results in the "searchresults.txt" file from html and py files in the directory as if the second "--exclude" was not working.
Can anyone tell me what's going on here?
Thanks