Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: 96d237c40a97f2db2f347f657669ff08c96a005e authored by Georg Brandl on 13 August 2011, 09:59:12 UTC
Update versions in LICENSE files.
Tip revision: 96d237c
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