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 3413558 commit 3a7ef49Copy full SHA for 3a7ef49
implement-shell-tools/cat/my_cat.py
@@ -22,13 +22,13 @@
22
line_num = 1
23
24
for line in lines:
25
- if args.number_nonblank:
26
- if line.strip() != "":
27
- print(f"{line_num:6}\t{line}", end="")
28
- line_num += 1
29
- else:
30
- print(line, end="")
31
- elif args.number:
+ should_number = False
+ if args.number_nonblank and line.strip():
+ should_number = True
+ elif args.number and not args.number_nonblank:
+
+ if should_number:
32
print(f"{line_num:6}\t{line}", end="")
33
line_num += 1
34
else:
individual-shell-tools/ls/script-01.sh
individual-shell-tools/ls/script-02.sh
0 commit comments