I want to count the number of 6-letter words that start with 'bar' and end with 'i' or 'n'.
For example, given this file:
barxxi barxxc barxxn barqwq barovo
the output should be 2 (integer), since these lines match:
My code is the following, but it seems to be wrong:
grep -c 'bar??[ni]' /path/file.txt