I need a script which shows a summary of which users have connected to my computer during the last week and how often.
I know I can use last and filter the
last
Try this
Steps
last > login.txt
last | awk '{print $3}' | sort -u > names.txt
Iterate each lines from names.txt and apply grep "line1" login.txt | wc -l
grep "line1" login.txt | wc -l
you will get count for each user (each user is each line in names.txt)