Buscar y ejecutar un comando
find . -name "*.txt" -exec echo {} \; -exec grep banana {} \;
Wide-eyed Wren
find . -name "*.txt" -exec echo {} \; -exec grep banana {} \;
multiple_cmd() {
tail -n1 $1;
ls $1
};
export -f multiple_cmd;
find *.txt -exec bash -c 'multiple_cmd "$0"' {} \;
find . -type d -exec sh -c "echo -n {}; echo -n ' x '; echo {}" \;
find ... | while read -r file; do
echo "look at my $file, my $file is amazing";
done