We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 226553e commit 8712e90Copy full SHA for 8712e90
1 file changed
Shell/tenth-line.sh
@@ -23,4 +23,13 @@
23
# 2. There's at least three different solutions. Try to explore all possibilities.
24
#
25
# Read from the file file.txt and output the tenth line to stdout.
26
+
27
+# Solution 1
28
awk '{if(NR==10) print $0}' file.txt
29
+awk 'NR == 10' file.txt
30
31
+# Solution 2
32
+sed -n 10p file.txt
33
34
+# Solution 3
35
+tail -n+10 file.txt | head -1
0 commit comments