I'm new in bash and awk, I have code like this:
i=0
while [ $i -lt 10 ] ;
do
tes1() {
set_from=$i;
if [ -z "${set_from}" ]; then set_from=1; fi
awk '
{
time=$1;
from=$3;
to=$4;
status=$5;
set_from = set_from_set;
set_to = 10;
if (from == set_from && to == set_to){
print time, from, to, status;
}
}' set_from_set="$set_from" tes.txt;
}
done
I don't know to get $i from the first line, maybe anybody here knows how to get that $i for function tes1()? Thankyou...