Bash - iterate_file_modify_output.sh

#!/bin/bash

# Iterate on file data.csv. Replace accordingly assuming it has two fields $1 and $2,

IFS=','

while read p; do
        echo "
        define host{
                use                     wap
                host_name               $(echo $p | awk '{ print $1}')
                alias                   $(echo $p | awk '{ print $1}')
                address                 $(echo $p | awk '{ print $2}')
        }"
done <data.csv