Your task is to write a shell script that summarizes the output of the "
last" command. For each user listed in the output of last,
your program should output one line summarizing the total of all the time
spent logged on by that user.
You will want to look at the output of the "last" command.
The command "cut" can be used to get fields from the output of
the last command.
The command "awk" can be used to get fields from the output of
the last command.
The command "grep -v" can be used to eliminate unwanted lines.
You can read a file into a shell script one line at a time like this ...
cat filename | while read a b c
do
echo $a $b $c
done
The "read" command reads from its stdin and assigns each
word on the input to the corsponding variable on the argument list. The last
variable gets all unused words on each input line. Look for the read
command in the bash man page for more info.