shell alias problem
alias searchit='find . ! -regex ".*\(svn\|gif\|jpg\|png\|svg\|ai\)$" -type f -exec grep -snH $1 {} \;'
after i execute with parameter it gets me: find: paths must precede expression Usage: find [path...] [expression] i tried putting -name "*", or in the path ".", but nothing... |
What is this supposed to do?
Quote:
|
the other has some problems, this one:
if i run $find '.' \( -type f -a ! -iregex ".*\(svn\|gif\|jpg\|png\|svg\|ai\).*" \) -name "*" -print -exec grep -snH "stringTosearch" {} \; works ok without a problem, but i want it like an alias, so i do this: alias findthis='find '.' \( -type f -a ! -iregex ".*\(svn\|gif\|jpg\|png\|svg\|ai\).*" \) -name "*" -print -exec grep -snH "$1" {} \;' the alias is setted fine, but when i do an $finthis stringTosearch or "stringTosearch"... whatever, i receive this message: find: paths must precede expression Usage: find [path...] [expression] i have tried $1 alone, "$1", "${1}", and in the path . '.'(like this one) ".". \., i think that i added also that -name * that seems isnt needed , whatever but nothing... if someone have some problem like this or find some reasonable explanation please post. pixellany ! is for not match... it has to be in that parentesis to work... thanks. |
All times are GMT -5. The time now is 03:02 PM. |