bash - How do I use a pipe in the exec parameter for a find command? -


i'm trying construct find command process bunch of files in directory using 2 different executables. unfortunately, -exec on find doesn't allow use pipe or \| because shell interprets character first.

here i'm trying (which doesn't work because pipe ends find command):

find /path/to/jpgs -type f -exec jhead -v {} | grep 123 \; -print 

try this

find /path/to/jpgs -type f -exec sh -c 'jhead -v {} | grep 123' \; -print 

alternatively try embed exec statement inside sh script , do:

find -exec some_script {} \; 

Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -