I want to make a list of the last words on each line of a file that looks like this:casper@casper-PC ~/scripts -> cat /tmp/fooupdate PTMM_ARCHIVE.FASTTRACK_USER set user_name = 'monohajoxx' where user_name = 'monohajo'update PTMM_ARCHIVE.FASTTRACK_USER set user_name = 'wuemxx' where user_name = 'wuem'update PTMM_ARCHIVE.FASTTRACK_USER set user_name = 'taraziemxx' where user_name = 'taraziem'update PTMM_ARCHIVE.FASTTRACK_USER set user_name = 'mullankexx' where user_name = 'mullanke'update PTMM_ARCHIVE.FASTTRACK_USER set user_name = 'fernanjaxx' where user_name = 'fernanja'casper@casper-PC ~/scripts ->As you can see, the file lacks a newline at the end: 'fernanja'casper@casper-PC ~/scripts ->. I hate that when the prompt gets mixed in with the data -or the output. It's a minor point, but it makes the text on the terminal jumbled and confusing.Also, I use tr all the time to fix my one-liners. I am looking for another way to print out the names in a horizontal line instead of a vertical list. I echo'd a new line but it printed it out literally.09:38 PM Tue Dec 01$ awk '{print $NF}' /tmp/foo | tr -d ' | tr \n , \s ; echo  \nmonohajo,wuem,taraziem,mullanke,fernanja,\nwalt@walt-PC ~/scripts ->09:55 PM Tue Dec 01$I do not want this: monohajowuemtaraziemmullankefernanjaI want this: monohajo, wuem, taraziem, mullanke, fernanjaThese are minor points, but when you do this 20 or thirty times a day, it gets tiring. It would be great just to do this in pure bash, with a while loop. Instead of vertical lists, I need horizontal lists which can be cut and pasted into emails, so I can tell bosses that I performed updates on this list of people.
Parsing users from a list of commands for email notifications
bash;formatting