Element: <file>

Syntax


<!ELEMENT file           (#PCDATA)>

This element occurs in the elements ; Element: <download> | Element: <search_replace> | Element: <textdump>.

Description

The element file is used to specify the file in a download, search_replace or textdump operation.

Examples

The first example is a search_replace.

<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

The second example is a textdump.

<textdump base="/etc">
        <file>group</file>

        <content>
                =root:x:0:
                =bin:x:1:
                =sys:x:2:
                =kmem:x:3:
                =tty:x:4:
                =tape:x:5:
                =daemon:x:6:
                =floppy:x:7:
                =disk:x:8:
                =lp:x:9:
                =dialout:x:10:
                =audio:x:11:
        </content>
</textdump>

The equivalent bash script is :

echo Generating file group
cd /etc

cat > group << 'EOF'
root:x:0:
bin:x:1:
sys:x:2:
kmem:x:3:
tty:x:4:
tape:x:5:
daemon:x:6:
floppy:x:7:
disk:x:8:
lp:x:9:
dialout:x:10:
audio:x:11:
EOF