#!/bin/bash INPUT=${INPUT:-input} NUM=$(wc -l < ${INPUT}) echo "#include " echo "" echo "const input_t INPUT[${NUM}] = {" while IFS= read -r line; do echo " $line, " done < $INPUT unset line echo "};" echo "const size_t INPUT_SIZE=${NUM};"