ia64/xen-unstable
changeset 9785:5b1e10215e38
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@us.ibm.com>
in $(...) instead of '`...`', otherwise the parser seems to get
confused.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
author | emellor@leeni.uk.xensource.com |
---|---|
date | Wed Apr 19 22:54:49 2006 +0100 (2006-04-19) |
parents | 909664b50602 |
children | a22ce69dd703 |
files | tools/examples/vtpm-common.sh |
line diff
1.1 --- a/tools/examples/vtpm-common.sh Wed Apr 19 22:52:34 2006 +0100 1.2 +++ b/tools/examples/vtpm-common.sh Wed Apr 19 22:54:49 2006 +0100 1.3 @@ -60,7 +60,7 @@ fi 1.4 function vtpmdb_find_instance () { 1.5 local vmname=$1 1.6 local ret=0 1.7 - instance=`cat $VTPMDB | \ 1.8 + instance=$(cat $VTPMDB | \ 1.9 awk -vvmname=$vmname \ 1.10 '{ \ 1.11 if ( 1 != index($1,"#")) { \ 1.12 @@ -69,7 +69,7 @@ function vtpmdb_find_instance () { 1.13 exit; \ 1.14 } \ 1.15 } \ 1.16 - }'` 1.17 + }') 1.18 if [ "$instance" != "" ]; then 1.19 ret=$instance 1.20 fi 1.21 @@ -86,13 +86,13 @@ function vtpmdb_is_free_instancenum () { 1.22 if [ $instance -eq 0 -o $instance -gt 255 ]; then 1.23 avail=0 1.24 else 1.25 - instances=`cat $VTPMDB | \ 1.26 + instances=$(cat $VTPMDB | \ 1.27 gawk \ 1.28 '{ \ 1.29 if (1 != index($1,"#")) { \ 1.30 printf("%s ",$2); \ 1.31 } \ 1.32 - }'` 1.33 + }') 1.34 for i in $instances; do 1.35 if [ $i -eq $instance ]; then 1.36 avail=0 1.37 @@ -110,13 +110,13 @@ function vtpmdb_get_free_instancenum () 1.38 local ctr 1.39 local instances 1.40 local don 1.41 - instances=`cat $VTPMDB | \ 1.42 + instances=$(cat $VTPMDB | \ 1.43 gawk \ 1.44 '{ \ 1.45 if (1 != index($1,"#")) { \ 1.46 printf("%s ",$2); \ 1.47 } \ 1.48 - }'` 1.49 + }') 1.50 ctr=1 1.51 don=0 1.52 while [ $don -eq 0 ]; do 1.53 @@ -163,7 +163,7 @@ function vtpmdb_validate_entry () { 1.54 local vmname=$1 1.55 local inst=$2 1.56 1.57 - res=`cat $VTPMDB | \ 1.58 + res=$(cat $VTPMDB | \ 1.59 gawk -vvmname=$vmname \ 1.60 -vinst=$inst \ 1.61 '{ \ 1.62 @@ -179,7 +179,7 @@ function vtpmdb_validate_entry () { 1.63 printf("2"); \ 1.64 exit; \ 1.65 } \ 1.66 - }'` 1.67 + }') 1.68 1.69 if [ "$res" == "1" ]; then 1.70 let rc=1 1.71 @@ -196,13 +196,13 @@ function vtpmdb_remove_entry () { 1.72 local vmname=$1 1.73 local instance=$2 1.74 local VTPMDB_TMP="$VTPMDB".tmp 1.75 - `cat $VTPMDB | \ 1.76 + $(cat $VTPMDB | \ 1.77 gawk -vvmname=$vmname \ 1.78 '{ \ 1.79 if ( $1 != vmname ) { \ 1.80 print $0; \ 1.81 } \ 1.82 - '} > $VTPMDB_TMP` 1.83 + '} > $VTPMDB_TMP) 1.84 if [ -e $VTPMDB_TMP ]; then 1.85 mv -f $VTPMDB_TMP $VTPMDB 1.86 vtpm_delete $instance