WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Under FC5 multi-line commands in bash script language ha

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Under FC5 multi-line commands in bash script language have to be wrapped
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 21 Apr 2006 16:42:11 +0000
Delivery-date: Fri, 21 Apr 2006 09:46:18 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID 5b1e10215e38cd1cc5e2385e35a14daa0d346cb4
# Parent  909664b50602a0ba4975c47a24a031a45d3a0cbe
Under FC5 multi-line commands in bash script language have to be wrapped
in $(...) instead of '`...`', otherwise the parser seems to get
confused.

Signed-off-by: Stefan Berger <stefanb@xxxxxxxxxx>

diff -r 909664b50602 -r 5b1e10215e38 tools/examples/vtpm-common.sh
--- a/tools/examples/vtpm-common.sh     Wed Apr 19 22:52:34 2006 +0100
+++ b/tools/examples/vtpm-common.sh     Wed Apr 19 22:54:49 2006 +0100
@@ -60,7 +60,7 @@ function vtpmdb_find_instance () {
 function vtpmdb_find_instance () {
        local vmname=$1
        local ret=0
-       instance=`cat $VTPMDB |                    \
+       instance=$(cat $VTPMDB |                   \
                  awk -vvmname=$vmname             \
                  '{                               \
                     if ( 1 != index($1,"#")) {    \
@@ -69,7 +69,7 @@ function vtpmdb_find_instance () {
                         exit;                     \
                       }                           \
                     }                             \
-                  }'`
+                  }')
        if [ "$instance" != "" ]; then
                ret=$instance
        fi
@@ -86,13 +86,13 @@ function vtpmdb_is_free_instancenum () {
        if [ $instance -eq 0 -o $instance -gt 255 ]; then
                avail=0
        else
-               instances=`cat $VTPMDB |                 \
+               instances=$(cat $VTPMDB |                \
                           gawk                          \
                           '{                            \
                               if (1 != index($1,"#")) { \
                                 printf("%s ",$2);       \
                               }                         \
-                           }'`
+                           }')
                for i in $instances; do
                        if [ $i -eq $instance ]; then
                                avail=0
@@ -110,13 +110,13 @@ function vtpmdb_get_free_instancenum () 
        local ctr
        local instances
        local don
-       instances=`cat $VTPMDB |                 \
+       instances=$(cat $VTPMDB |                \
                   gawk                          \
                   '{                            \
                       if (1 != index($1,"#")) { \
                         printf("%s ",$2);       \
                       }                         \
-                   }'`
+                   }')
        ctr=1
        don=0
        while [ $don -eq 0 ]; do
@@ -163,7 +163,7 @@ function vtpmdb_validate_entry () {
        local vmname=$1
        local inst=$2
 
-       res=`cat $VTPMDB |             \
+       res=$(cat $VTPMDB |            \
             gawk -vvmname=$vmname     \
                  -vinst=$inst         \
             '{                        \
@@ -179,7 +179,7 @@ function vtpmdb_validate_entry () {
                    printf("2");       \
                    exit;              \
                 }                     \
-            }'`
+            }')
 
        if [ "$res" == "1" ]; then
                let rc=1
@@ -196,13 +196,13 @@ function vtpmdb_remove_entry () {
        local vmname=$1
        local instance=$2
        local VTPMDB_TMP="$VTPMDB".tmp
-       `cat $VTPMDB |             \
+       $(cat $VTPMDB |            \
         gawk -vvmname=$vmname     \
         '{                        \
            if ( $1 != vmname ) {  \
              print $0;            \
            }                      \
-        '} > $VTPMDB_TMP`
+        '} > $VTPMDB_TMP)
        if [ -e $VTPMDB_TMP ]; then
                mv -f $VTPMDB_TMP $VTPMDB
                vtpm_delete $instance

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Under FC5 multi-line commands in bash script language have to be wrapped, Xen patchbot -unstable <=