While auditing the shell version of dejagnu-report-card for POSIX compliance, whether POSIX sed(1) is actually required to support using semicolon as a command separator seems to be unclear, but does permit multiple "-e" options. The text in <URL:http://pubs.opengroup.org/onlinepubs/009695399/utilities/sed.html> seems to suggest that only newlines are valid command separators, but that each "-e" option effectively has a newline appended.

This patch removes the one use of semicolon in a sed(1) program in the dejagnu(1) multi-launcher.

----
ChangeLog entry:
        * dejagnu: Avoid use of semicolon as sed(1) command separator.
        POSIX does not clearly require sed(1) to support that feature.
----
patch:
----
diff --git a/dejagnu b/dejagnu
index 6cd52f6..7e75940 100755
--- a/dejagnu
+++ b/dejagnu
@@ -402,7 +402,7 @@ if $want_help ; then
        exit 2
    fi
    help_prefix_pat=$(grep '#help' "$help_file" \
-       | sed 's/#help.*$//;1q' | tr '[:print:][:blank:]' .)
+       | sed -e 's/#help.*$//' -e '1q' | tr '[:print:][:blank:]' .)
    if expr "$verbose" \> 1 > /dev/null ; then
        echo Extracting help from "'$help_file'" with prefix 
"'$help_prefix_pat'"
    fi
----


-- Jacob

_______________________________________________
DejaGnu mailing list
DejaGnu@gnu.org
https://lists.gnu.org/mailman/listinfo/dejagnu

Reply via email to