find: missing argument to -exec in bash script
- by Mephi_stofel
The following works fine when I type it exactly in the command line:
find /<some_path>/{epson,epson_laser,epson_inkjet} -iname "*.ppd"
-exec grep "\*ModelName\:" {} \; | sed 's/.*\"\(.*\)\"/\1/'
However, when I try to call the following from a
bash script I get find: missing argument to -exec'.
I have also tried the following (in many variants):
eval find "$1" -iname "*.ppd" -exec 'bash -c grep "\*ModelName\:" "$1" | sed "s/.*\"\(.*\)\"/\1/" \;
as was mentioned in find-exec-echo-missing-argument-to-exec.