OILS / opy / _regtest / src / spec / bin / stdout_stderr.py View on Github | oilshell.org

23 lines, 13 significant
1#!/usr/bin/env python
2from __future__ import print_function
3"""
4stdout_stderr.py
5
6Tool for testing redirects.
7"""
8
9import sys
10
11
12def main(argv):
13 try:
14 stdout = argv[1]
15 stderr = argv[2]
16 except IndexError:
17 stdout = 'STDOUT'
18 stderr = 'STDERR'
19 print(stdout)
20 print(stderr, file=sys.stderr)
21
22if __name__ == '__main__':
23 main(sys.argv)