bash > replace read lines from a file > compare and replace > save new file with the replacement line name

PHOTO EMBED

Mon Jan 17 2022 14:58:05 GMT+0000 (Coordinated Universal Time)

Saved by @confis #bash

#!/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"
content_copyCOPY

טוען קובץ קורא שורה שורה | משווה טקסט ומחליף שורה מהקובץ היעד בטקסט מהקובץ הראשון | שומר קובץ חדש בשם הטקסט המוחלף