#!/bin/sh for file do if [ ! -f ${file} ]; then continue fi STR=`cat ${file}` if [ -z "${STR}" ]; then rm ${file} fi done