used bash string regexp support instead of grep