pwl_target_load: line 1656: syntax error: unexpected end of file

Adi Linden [email protected]
Wed, 20 Dec 2000 00:27:20 -0600 (CST)


Hi,

Fixed the pwl_target_load and pwl_target_functions script to work properly
with bash-2.x. The cause of the problem is a documented incomatability
between bash-1.14 and bash-2.03. 

So version 0.53.25 will be uploaded shortly...

Below find the 'technical' explanation...

TTYL,
Adi



 

In those scripts I redirect output from certain commands to $rd_log or
/dev/null depending on the circumstances. Here is an offending line
example:

{ dd if=$rd_loop_dev bs=1k count=$rd_size_fs | gzip -v9 > $rd_tmp/$rd_ramdisk } >>$rd_log 2>&1

Things are working after adding a semicolon just before the closing
bracket, like so:

{ dd if=$rd_loop_dev bs=1k count=$rd_size_fs | gzip -v9 > $rd_tmp/$rd_ramdisk; } >>$rd_log 2>&1

Here is the excerpt from the bash2 COMPAT file for reference:

--- Quote ---

2.  One of the bugs fixed in the YACC grammar tightens up the rules
    concerning group commands ( {...} ).  The `list' that composes the
    body of the group command must be terminated by a newline or
    semicolon.  That's because the braces are reserved words, and are
    recognized as such only when a reserved word is legal.  This means
    that while bash-1.14 accepted shell function definitions like this:

        foo() { : }

    bash-2.0 requires this:

        foo() { :; }

    This is also an issue for commands like this:

        mkdir dir || { echo 'could not mkdir' ; exit 1; }

    The syntax required by bash-2.0 is also accepted by bash-1.14.

--- Unquote ---

---------------------------------------------------
See the list archives at http://adis.on.ca/archives/
See the PWL homepage at  http://peeweelinux.com
---------------------------------------------------