#!/bin/bash if grep -RIZ "123" target | xargs -0 cp -t .; then echo "cp - ОК" else echo "cp - FAILS" fi if grep -RLZ "123" target | xargs -0 rm; then echo "rm - ОК" else echo "rm - FAILS" fi