You are not logged in.
Pages: 1
hi
i want to make me a bash function which executes find -iname '*[foo]*'
my try
function search {
find -iname '*$1*'
}
didn't work
„Je verdinglichter die Welt, je dichter das Netz, das der Natur überworfen wurde, desto mehr beansprucht ideologisch das Denken, das jenes Netz spinnt, seinerseits Natur, Urerfahrung zu sein." Theodor W. Adorno [aus: Wozu noch Philosopie]
Offline
search() {
find -iname '*$1*'
}
Offline
What about:
find -iname "*$1*"
Offline
Use double quotes, like jasonwryan suggested.
'man bash', section QUOTING has some info on this:
There are three quoting mechanisms: the escape character, single
quotes, and double quotes.
...
Enclosing characters in single quotes preserves the literal value of
each character within the quotes.
...
The special parameters * and @ have special meaning when in double
quotes (see PARAMETERS below)
Offline
Pages: 1