#!/bin/bash for FILE_NAME in ./test/*.xml; do ABSOLUTE_PATH=$(realpath "${FILE_NAME}") cat >conf.xml < ${ABSOLUTE_PATH} EOF done