Skip to content

Commit 978cc0a

Browse files
committed
use sort-tail-head pipeline to get the player with the second highest first score.
1 parent b219887 commit 978cc0a

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

shell-pipelines/sort-uniq-head-tail/script-04.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ set -euo pipefail
55
# The input for this script is the scores-table.txt file.
66
# TODO: Write a command to output scores-table.txt, with shows the line for the player whose first score was the second highest.
77
# Your output should be: "Piotr Glasgow 15 2 25 11 8" (without quotes).
8+
sort -k3 -nr scores-table.txt | tail -n +2 | head -n 1

0 commit comments

Comments
 (0)