#!/usr/bin/env zsh cat hardware.csv | cut -d, -f 1,4,5 | grep -v TODO | grep -v name | while read line; do NAME=$(echo $line | cut -d, -f 1) IPSUFF=$(echo $line | cut -d, -f 2 | cut -d. -f 1) MAC=$(echo $line | cut -d, -f 3) echo "config host" echo "\toption name '$NAME'" echo "\toption mac '$MAC'" echo "\toption ip '10.0.0.$IPSUFF'" echo "\toption dns '1'" done