In my .bash_profile, I have a function that returns all php files containing the parameter string passed in:
summon() {
"find . -name '*.php' -exec grep -ril '$1' '{}' \;"
}
When I am on my command line (mac) and I run summon foo, I get the error:
-bash: find . -name '*.php' -exec grep -ril 'foo' '{}' \;: command not found
But if I just copy/paste the find . -name '*.php' -exec grep -ril 'foo' '{}' \; into the command line, then it works properly, returning all of the php files that contain the string 'foo'.
Does anyone have any idea why the function is not being evaluated?