Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: eb96c376994cb7c6c2e8a4967782d1c0e2a96135 authored by Ned Deily on 02 May 2018, 07:41:45 UTC
3.7.0b4
Tip revision: eb96c37
qgrep.py
"""When called with a single argument, simulated fgrep with a single
argument and no options."""

import sys

if __name__ == "__main__":
    pattern = sys.argv[1]
    for line in sys.stdin:
        if pattern in line:
            sys.stdout.write(line)
back to top