Element: <textdump>

Syntax

<!ELEMENT textdump       (file, content)>
<!ATTLIST textdump
          base           CDATA #IMPLIED
          mode           CDATA #IMPLIED>

This element occurs in : Element : <alfs> | Element: <stage>

See also : Element: <file> | Element : <content>

Description

The textdump element is one of the top-level operation elements. It allows you to create a text file containing specified text.

The file child-element contains the name of the file to be created.

The content child-element is used to specify the content of the file being created when processing a textdump operation. When processing the textual content of this element, one removes the leading blanks up to and including a '=' character.

The base attribute allows you to specify the directory in which the operation will be performed. For a better description, see Element : <base>.

The mode attribute allows you to specify the append creation mode.

Example #1

<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 :

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

Example #2

<textdump mode="append">

        <file>/etc/sysconfig/network</file>

        <content>
                =GATEWAY=192.168.123.254
                =GATEWAY_IF=eth0
        </content>

</textdump>

The equivalent bash script is :

echo Generating file /etc/sysconfig/network
cat >> /etc/sysconfig/network << 'EOF'
GATEWAY=192.168.123.254
GATEWAY_IF=eth0
EOF