I'm trying to run the convert
command on some images to resize them.
find build_reports/functional_tests/results -name '*.png' | xargs -I {} sh -c 'convert -resize 20% {} {}'
The problem that I have is that the files have ( and ) in their names (e.g. build_reports/functional_tests/results/Attachments/Screenshot of main screen (ID 1)_1_0FEF8183-AF87-4517-928D-8C4A2ED984D0.png) and I cannot rename these files because their linked somewhere else.
When I run the command I get the following warnings and the images are not resized
sh: -c: line 0: syntax error near unexpected token `('
sh: -c: line 0: `convert -resize 20% build_reports/functional_tests/results/Attachments/Screenshot of main screen (ID 1)_1_D94BAEBC-F463-4EEE-8FAE-C49AFF4A8FFE.png {}'
Is there anyway to get rid of these warning and make this work by somehow escaping the result of the find command?