[Fedora-livecd-list] [PATCH] Fix unquoted $(cat ...) in mayflower's big here-doc,

Jim Meyering jim at meyering.net
Tue Nov 6 18:58:21 UTC 2007


Hi,

I noticed that the following part of the big here-document
in creator/mayflower was not backslash-escaped (along with the
following two lines):

    cat > init <<EOF
    ...
    if [ -f /etc/fstab ] ; then
        root=$(cat /etc/fstab | while read d m f o r; do if [ "$m" == "/" ] ; then echo $d; fi; done)

So it would end up generating hard-coded bits like this:

    if [ -f /etc/fstab ] ; then
        root=dm_multipath

[dm_mulipath came from an earlier loop where $m iterated
through module names]

At first I just fixed that by backslash-quoting things,
but then I realized that nothing in that entire here document
required expansion, so I've attached a better patch.

The patch looks big, but it's largely mechanical:
It uses <<'EOF' rather than <<EOF, which saves you the readability
and maintenance hassle of backslash-escaping all of the "$" and "`"
in the "init" here-doc.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: livecd-p1
URL: <http://listman.redhat.com/archives/fedora-livecd-list/attachments/20071106/ed3f7f5a/attachment.ksh>


More information about the Fedora-livecd-list mailing list