I have a log file that contains several lines, each with an IP, username, and URL. I need to create something that will take each IP in the line and, if starting with a 10 will append the word "ON" to the end of the line containing it. All other lines with any other IP not starting with a 10 will need to have the word "OFF" appended to it.
Example of log file:
10.10.10.10 jsmith1234 [URL] 220.127.116.11 jsmith1234 [URL]
Example of what I want:
10.10.10.10 jsmith1234 [URL] ON 18.104.22.168 jsmith1234 [URL] OFF
I believe an if, then, else statement would work (used in a bash shell script), but I am very new to these and not sure where to start.