def decompressCmd(path, default="cat"):
    """"return the command to decompress the file to stdout, or default if not compressed, which defaults
    to the `cat' command, so that it just gets written through"""
    if path.endswith(".Z") or path.endswith(".gz"):
        return "zcat"
    elif path.endswith(".bz2"):
        return "bzcat"
    else:
        return default