#!/bin/bash calc_wind_power(){ x=$1 a=$2 echo ${x} ${a}| awk '{ val=$1/$2; if(val >= int(val)+0.5){ printf "%d\n",int(val)+1 }else{ printf "%d\n" ,int(val) } }' } read t for i in $(seq 1 ${t}) do read d a for j in $(seq 1 ${d}) do read x calc_wind_power ${x} ${a} done done