Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 21 lines (15 sloc) 431 Bytes
#!/usr/bin/env python
"""
tabawk [same args as awk]
Wrapper around 'awk' for tab-separation for both input and output records
"""
import sys, subprocess, os
if len(sys.argv)==1:
print>>sys.stderr, __doc__.strip()
sys.exit(1)
awk_args = sys.argv[1:]
awk_cmd = (os.environ.get("AWK") or "awk").strip()
cmd = [awk_cmd, "-F\t", "-v", r"OFS=\t"] + awk_args
# print>>sys.stderr, cmd
ret = subprocess.call(cmd)
sys.exit(ret)