nmdc-webfrontend/minipack

23 lines
282 B
Plaintext
Raw Normal View History

#!/bin/bash
2017-10-27 11:21:20 +00:00
set -eu
embed() {
local tag="$1"
local find="$2"
local sourcefile="$3"
2017-10-27 11:21:20 +00:00
while IFS= read -r line ; do
if [[ "${line}" =~ "${find}" ]] ; then
echo -n "<${tag}>"
cat "${sourcefile}"
echo -n "</${tag}>"
else
echo "${line}"
fi
done
2017-10-27 11:21:20 +00:00
}
embed "$@"