qgrep.py 253 B

12345678910
  1. """When called with a single argument, simulated fgrep with a single
  2. argument and no options."""
  3. import sys
  4. if __name__ == "__main__":
  5. pattern = sys.argv[1]
  6. for line in sys.stdin:
  7. if pattern in line:
  8. sys.stdout.write(line)