#!/bin/sh word="$1" dir="$2" for x in $dir; do grep $word $x found $? if [ $found -eq 0 ] then rm -fv $x fi done