From 1161fc80e9d23d83e325d7372f92a410b2498837 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 7 Dec 2017 16:42:42 +0100 Subject: scripts/truncate_stream: Accept input on stdin --- scripts/truncate-stream | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/truncate-stream b/scripts/truncate-stream index 60679d30..7de5c953 100755 --- a/scripts/truncate-stream +++ b/scripts/truncate-stream @@ -114,7 +114,11 @@ if not (opt.ifn and opt.ofn): print("You need at least --input and --output") exit(1) -f = open(opt.ifn, 'r') +if opt.ifn == "-": + f = sys.stdin +else: + f = open(opt.ifn, 'r') + g = open(opt.ofn, 'w') start_after = opt.start stop_after = opt.stop -- cgit v1.2.3