I am trying to build and run a find
command from a script. But I get a very cryptic error message from find
. The following basically sums up how I build the command line and run it
$ xx="find . -name 'p*' -mmin +10 -exec echo {} \\;"
$ echo "$xx" #.....and I get the same print from echo $xx
find . -name 'p*' -mmin +10 -exec echo {} \;
$ $xx
find: missing argument to `-exec'
$ find . -name 'p*' -mmin +10 -exec echo {} \;
./p2.sh
./p1.sh
$ read xx
find . -name 'p*' -mmin +2 -exec echo {} \\;
$ $xx
find: missing argument to `-exec'
I am stuck and will appreciate your help. I am also wondering what's causing this. I am using bash 3.2.51 on SLES.
The actual command I want to execute is a little bit longer but I used echo
here just to illustrate.
Thanks Dinesh