Bash - Template

About

Method

HereDoc

with here_document

#!/bin/bash

for FILE_NAME in ./test/*.xml; do
    ABSOLUTE_PATH=$(realpath "${FILE_NAME}")
    cat >conf.xml <<EOF
<?xml>
<root>
	<project name="project">
		<workflow name="wf1">
			<parameter name ="sourcefilename">${ABSOLUTE_PATH}</parameter>
		</workflow>
	</project>
</root>
EOF
done

Envsubst utility

See envsubst


Powered by ComboStrap