combine multiple finds into 1-liner

How to combine 3 find statements into 1-liner?

find statements:

cd ${dir1} ; find . ! -name . -prune -type f | xargs file | grep -i ascii | cut -f1 -d: | xargs grep -l "${searchtxt}"
cd ${dir2} ; find . ! -name . -prune -type f | xargs file | grep -i ascii | cut -f1 -d: | xargs grep -l "${searchtxt}"
cd ${dir3} ; find . ! -name . -prune -type f | xargs file | grep -i ascii | cut -f1 -d: | xargs grep -l "${searchtxt}"

pls advise and thanks in advance.

find "$dir1" "$dir2" "$dir3"  ! -name . -prune -type f | xargs file | grep -i ascii | cut -f1 -d: | xargs grep -l "${searchtxt}"

Should work.
No need to quote if you're sur there are no blanks in dir names.

doesn't work :frowning:

Do you have any idea how unhelpful that kind of response is?

What doesn't work?

The command, such as it is, works fine for me.

the proposed find statement below doesn't work as expected:

find "$dir1" "$dir2" "$dir3"  ! -name . -prune -type f | xargs file | grep -i ascii | cut -f1 -d: | xargs grep -l "${searchtxt}"

no output from the above statement. this is because when dirs are specificied in the find, the statement couldn't find name "." which is not pruned.