updated grep.gura script
fixed a bug that sys.stdout will be close after copy function is applied