I am processing my text file using awk. I have written the code below:
#!/bin/bash
l=1
while [ $l -lt 5 ]
do
echo $l
awk -v L=$l '/^BS[0-5]|^FG[2-7]/ && length<10 {i++}i==L {print}'
l=$(expr $l + 1)
done <input.txt
But, once i run the code I just get first awk output. Would you please let me know how can I fix this code?