diff options
author | alexv-smirnov <alex@ydb.tech> | 2023-06-13 11:05:01 +0300 |
---|---|---|
committer | alexv-smirnov <alex@ydb.tech> | 2023-06-13 11:05:01 +0300 |
commit | bf0f13dd39ee3e65092ba3572bb5b1fcd125dcd0 (patch) | |
tree | 1d1df72c0541a59a81439842f46d95396d3e7189 /build/scripts/cat.py | |
parent | 8bfdfa9a9bd19bddbc58d888e180fbd1218681be (diff) | |
download | ydb-bf0f13dd39ee3e65092ba3572bb5b1fcd125dcd0.tar.gz |
add ymake export to ydb
Diffstat (limited to 'build/scripts/cat.py')
-rwxr-xr-x | build/scripts/cat.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/build/scripts/cat.py b/build/scripts/cat.py new file mode 100755 index 0000000000..0c3f73d96f --- /dev/null +++ b/build/scripts/cat.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python +import sys +from shutil import copyfileobj as copy +import os.path + +if __name__ == '__main__': + for filename in sys.argv[1:] or ["-"]: + if filename == "-": + copy(sys.stdin, sys.stdout) + else: + if os.path.exists(filename): + with open(filename, 'rb') as file: + copy(file, sys.stdout) + else: + sys.stderr.write('cat.py: {0}: No such file or directory\n'.format(filename)) |