Gebruik een while-lus en stream de SQL naar mysql:
#!/bin/bash
inputfile="test.txt"
cat "$inputfile" | while read ip mac server; do
echo "INSERT INTO test (IP, MAC, SERVER) VALUES ('$ip', '$mac', '$server');"
done | mysql -uroot -ptest testHet voordeel is dat het bestand niet volledig in het geheugen hoeft te worden geladen.