<!ELEMENT search_replace (file, find, replace)>
<!ATTLIST configure
base CDATA #IMPLIED>
|
This element occurs in the elements alfs, else, stage. and then
The element search_replace is used to perform a search and replace operation of a file.
The sub-element file contains the filename
The sub-element find contains the string to be searched
The sub-element replace contains the replacement string.
<search_replace
base = "/usr/src/mypackage">
<file>runit.sh</file>
<find>BINDIR</find>
<replace>/bin</replace>
</search_replace>
|
The equivalent bash script is :
echo Performing substitution in runit.sh cd /usr/src/mypackage cp runit.sh /tmp/foo.$$ sed -e 's/BINDIR/\/bin/' /tmp/foo.$$ > runit.sh |