#!/bin/bash File="domainList.txt" while IFS= read -r line do cat sample.yml | sed 's/foo.com/'$line'/g' > /path_to_dir/dir_name/$line.yml echo "domain: $line" done < "$File"
#!/bin/bash File="domainList.txt" while IFS= read -r line do cat sample.yml | sed 's/foo.com/'$line'/g' > /path_to_dir/dir_name/$line.yml echo "domain: $line" done < "$File"