Frans Pop wrote: [snip] > + if $(echo "$line" | grep -q "^:$1$"); then [snip] > + line=`cat_shortlist $2| grep "$COUNTRYNAME$"` I think such grep expressions need a shell escape in front of the second $ sign. It may work nevertheless in these instances, but... Thiemo