.cfg file to .awk file
Clash Royale CLAN TAG #URR8PPP 1 My color.cfg file from where I am reading a file is as below. marks,<,80,green marks,>,80,yellow I want to convert above color.cfg file into color.awk as below function check() if ( marks < 80 ) return "green" if (marks > 800) return "yellow" I have a shell script like below to convert .cfg to .awk. LINECT=0 while read LINE do var1[$LINECT]=$(echo $LINE | cut -d ',' -f1) var2[$LINECT]=$(echo $LINE | cut -d ',' -f2) var3[$LINECT]=$(echo $LINE | cut -d ',' -f3) var4[$LINECT]=$(echo $LINE | cut -d ',' -f4) LINECT=$((LINECT+1)) done < color.cfg echo $var1[@] echo $var2[@] echo $var3[@] echo $var4[@] echo $LINECT cat <<EOF > color.awk function check() if ($var1[0] $var2[0] $var3[0] ) return "$var4[0]" EOF My problem is how to write repetitive “if blocks” while writing a color.awk I have written “if block once but how to write if have 2 or 3 or 4 condi...