Skip to content

Instantly share code, notes, and snippets.

@sjkillen
Created February 23, 2018 01:41
Show Gist options
  • Save sjkillen/39e006df865afb64d1434bd627d9af52 to your computer and use it in GitHub Desktop.
Save sjkillen/39e006df865afb64d1434bd627d9af52 to your computer and use it in GitHub Desktop.
Write entire contents of file to stdout and then pipe stdin to stdout
#!/usr/bin/python3
from sys import argv
with open(argv[1]) as f:
print(f.read(), end="")
try:
while True:
print(input(), end="")
except EOFError:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment