Possible Duplicate:
Why does Mac's $find not have the option -printf?
Not sure what is wrong with the following command, but can anyone spot the error:
find public_html -name '*.php' -printf '%h \n' | sort -u > dirlist.txt
Basically, I am attemtping to find out in my public_html directory names of all directories that have *.php extension. and then print out the directory in which that file is found. The output of this is piped to sort, duplicate entries are removed by the -u flag, and the result is stored in new file dirlist.txt
But what I am getting upon execution is :
find: -printf: unknown option
Not sure where I am getting this wrong
Thanks