Skip to content

Commit cd346e1

Browse files
author
Shaghayeghfar
committed
task 6 and task 7 were done
1 parent a69bfc8 commit cd346e1

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
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

0 commit comments

Comments
 (0)