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 29258e9 commit dad3daaCopy full SHA for dad3daa
1 file changed
implement-shell-tools/cat/cat.py
@@ -8,8 +8,16 @@
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)
+# print(args)
12
+line_number=1
13
for per_file in args.path :
14
with open(per_file,"r") as f:
- print(f.read())
15
+ if args.n :
16
+ lines=f.readlines()
17
+ for line in lines :
18
+ print(line_number,line,end="")
19
+ line_number=line_number+1
20
+
21
22
+ print(f.read())
23
0 commit comments