File tree Expand file tree Collapse file tree
shell-pipelines/sort-uniq-head-tail Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,4 +5,4 @@ set -euo pipefail
55# The input for this script is the events.txt file.
66# TODO: Write a command to show how many times anyone has entered and exited.
77# It should be clear from your script's output that there have been 5 Entry events and 4 Exit events.
8- cat events.txt | sort | uniq -c
8+ cat events.txt | awk ' {print $1} ' | sort | uniq -c
Original file line number Diff line number Diff line change 1- cut -d' ' -f3 events-with-timestamps.txt | sort | uniq -c
1+ #! /bin/bash
2+
3+ set -euo pipefail
4+
5+ # The input for this script is the events-with-timestamps.txt file.
6+ # TODO: Write a command to show how many times anyone has entered and exited.
7+ # It should be clear from your script's output that there have been 5 Entry events and 4 Exit events.
8+ # The word "Event" should not appear in your script's output.
9+ awk ' {print $3}' events-with-timestamps.txt | tail -n+2 | sort | uniq -c
You can’t perform that action at this time.
0 commit comments