awk -v var=value_of_wherever '$1 >= var' input_file See the following example #/bin/bash let i=1 for ((i=1; i # this is also called the C-like loop echo 'i = ' $i echo -n 'Now see awk result: ' awk -v test_value=$i '$1 == test_value' data_file # use -v option in awk to assign the variable $i # to test_value, which is passed inside the awk # command inside quotes. done