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 f3b6b52 commit 87ed47eCopy full SHA for 87ed47e
1 file changed
implement-shell-tools/cat/cat.py
@@ -10,33 +10,22 @@
10
parser.add_argument("path", nargs="+", help="The file to search")
11
12
args = parser.parse_args()
13
+number = 1
14
15
for file_path in args.path:
16
with open(file_path, "r") as f:
17
content = f.readlines()
18
19
if args.n:
- number = 1
20
for line in content:
21
print(f"{number}\t{line.strip()}")
22
number +=1
23
elif args.b:
24
25
26
if line.strip() !="":
27
28
29
else:
30
print("")
31
32
- print("".join(content))
33
-
34
35
36
37
-# if args.b:
38
-# number=1
39
-# for line in content:
40
-# print
41
42
-# print(content)
+ print("".join(content))
0 commit comments