MySQL connection in shell script - how to?
List,
I have a file named 'hits' om my drive that looks like:
43 10.10.10.1
79 10.11.12.12
678 10.23.34.45
...
At the moment I create a MySQL batch file from the 'hits' file like above and run the batch query:
SELECT * FROM sitelist WHERE address LIKE 10.10.10.1
SELECT * FROM sitelist WHERE address LIKE 10.11.12.12
SELECT * FROM sitelist WHERE address LIKE 10.23.34.45
...
The result then looks like:
Rome
Amsterdam
Brussels
while I'd better like something like this:
43 10.10.10.1 Rome
79 10.11.12.12 Amsterdam
678 10.23.34.45 Brussels
...
I have no clue how to combine the 'hits' with the result of the query... Anyone an idea?
Kind regards,
Philip
|