#!/usr/bin/env bash # prevent output of "$1/*.xml" as file # if the target directory is empty shopt -s nullglob cd $1 cat < EOF for item in *.xml ; do echo " ${item}" done cat < EOF