[Tutor] A question about using stdin/out/err vs named files
George R Goffe
grgoffe at yahoo.com
Sun Oct 19 14:32:16 CEST 2014
Hi,
Wow. Lots of feedback. REALLY GOOD FEEDBACK!
This was my first question to this list. Let me clarify my question.
I want to use tst.py as follows:
tst.py input-file output-file OR
cat data-file | tst.py - output-file OR
cat data-file | tst.py output-file
tst.py input-file output-file works well
tst.py - output-file works well
The question boils down to "tst.py output-file"... which is a "parsing the args" question which you "guys" have caused me to think more clearly about. If there's just 1 arg, consider it an output-file and read from stdin and write to output-file ONLY if output-file does not exist.
Thank you all for your very helpful and informative responses.
Regards,
George...
More information about the Tutor
mailing list