#!/bin/sh rows="........................................................................\n........................................................................\n" for file in $(ls) do [[ "$(echo "$file" | cut -d'.' -f2)" == "txt" ]] && echo -e "$rows$(cat $file)" > $file done