3Prints the nth line of a file.
5This is meant to fill a gap between the Unix utilities ``head`` and
6``tail``, which I normally use in one of the following forms:
11which print the first/last 5 lines of a file, respectively.
13This command fills the gap -- it gets the nth line of a file, e.g. this
14prints the 100th line of the file:
16 $ body -n 100 myfile.txt
24if __name__ == "__main__":
25 parser = argparse.ArgumentParser()
27 parser.add_argument("-n", required=True, dest="lineno", type=int)
28 parser.add_argument("PATH")
30 args = parser.parse_args()
32 for lineno, line in enumerate(open(args.PATH), start=1):
33 if lineno == args.lineno: