wrap grep in a bash function to fix return value