23 lines
282 B
Bash
Executable File
23 lines
282 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -eu
|
|
|
|
embed() {
|
|
local tag="$1"
|
|
local find="$2"
|
|
local sourcefile="$3"
|
|
|
|
while IFS= read -r line ; do
|
|
if [[ "${line}" =~ "${find}" ]] ; then
|
|
echo -n "<${tag}>"
|
|
cat "${sourcefile}"
|
|
echo -n "</${tag}>"
|
|
else
|
|
echo "${line}"
|
|
fi
|
|
done
|
|
|
|
}
|
|
|
|
embed "$@"
|