Sed

From Blue-IT.org Wiki

Revision as of 20:26, 10 February 2012 by Apos (talk | contribs) (Created page with "== Save search and replace == search="$(printf "%s\n" "src=\"${SUBDIR}" | sed 's/[][\.*^$/]/\\&/g')" replace="$(printf "%s\n" "src=\"${ANOTHER_DIR}/${SUBDIR}" | sed 's/[][\.*^$/...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Save search and replace

search="$(printf "%s\n" "src=\"${SUBDIR}" | sed 's/[][\.*^$/]/\\&/g')" replace="$(printf "%s\n" "src=\"${ANOTHER_DIR}/${SUBDIR}" | sed 's/[][\.*^$/]/\\&/g')" sed "s/${search}/${replace}/g" "${DOC}"