#!/bin/bash

echo $str | sed "s/${srch}/${srch}\n/g" | grep -c $srch