I have a CGI script (written in Bash) that is going to log some information about people how visit my website. I have this kind of information through $HTTP_USER_AGENT, but I want to log log it in my database using different columns for OS, Browser Type, Browser Version, etc. Here is how the string looks like in my browser:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36
In this case I would like to log that the access was made from a Mac OS X 10_9_1 using Chrome version 32.0.1700.107.
I guess someone have already done this string processing job and I'm not being able to search it through the right keywords here in StackOverflow. Does anyone know how to do it? I can port it from other languages to Bash, I guess it won't be a problem!
Thank you all in advance!