PRELOADS="" for f in `find src -name '*.js'`; do PRELOADS=$PRELOADS"" done sed -i.bak "s#.*PRELOADS_PLACEHOLDER.*#$PRELOADS#" index.html