How to get the last column using cut
Sending multiple lines into a pipe
Sending a string into a pipe
How to read a file line by line in Bash