unix - How to find jar does not have a given string in linux -
i want list of jar archives not have particular string in contents.
i used following command find jar archives containing files matching string "hello"
:
find . -iname '*.jar' -printf "unzip -c %p | grep -q 'hello' && echo %p\n" | sh.
i tried following command find jar archives containing no files matching string "hello"
, not working:
find . -iname '*.jar' -printf "unzip -c %p |!( grep -q 'hello') && echo %p\n" | sh
basically may change &&
||
operator:
find . -iname '*.jar' -printf "unzip -c %p | grep -q 'hello' || echo %p\n" | sh.
and , or lists sequences of 1 of more pipelines separated && , || control operators, respectively. , and or lists executed left associativity.
, list has formcommand1 && command2
command2 executed if, , if, command1 returns exit status of zero.
an or list has form
command1 || command2
command2 executed if , if command1 returns non-zero exit status. return status of , and or lists exit status of last command executed in list.
Comments
Post a Comment