We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent df6314b commit 29258e9Copy full SHA for 29258e9
1 file changed
implement-shell-tools/cat/cat.py
@@ -0,0 +1,15 @@
1
+import sys
2
+import glob
3
+import argparse
4
+
5
+parser=argparse.ArgumentParser(prog="cat",
6
+ usage="implement a simple cat")
7
+parser.add_argument("-n",action="store_true",help="number the output lines")
8
+parser.add_argument("-b",action="store_true",help="number the output lines without blank ones")
9
+parser.add_argument("path",nargs="*",help="files to read")
10
+args=parser.parse_args()
11
+print(args)
12
+for per_file in args.path :
13
+ with open(per_file,"r") as f:
14
+ print(f.read())
15
0 commit comments