putting find in a bash_profile function

I want to make bash function in my .bash_profile that basically does a find ./ -name $1, very simple idea, seems not to work. My tries don't print things the right way i.e.:

find_alias() {
     `find ./ -name $1 -print`                                                                                                                                                                           
 }
 alias ff='find_alias $1'

The above if I do something like ff *.xml I get the following one liner:

bash: .pom.xml: Permission denied

The following after that:

find_alias() {
    echo -e `find ./ -name $1 -print`
}
alias ff='find_alias $1'

does find them all, but puts the output of that onto one massive long line, what am I doing wrong here?

Answers


find_alias() {
  find ./ -name $1 -print
}

You don't need, nor want, the backticks. That would try to execute what the find command returns.


Need Your Help

How far should the responsibilities of DAOs go?

design-patterns persistence dao

DAO, also called mapper (I think), is a Core Java EE pattern.