Browse Source

AMBARI-8320. configs.sh doConfigFileUpdate fails when multiple occurrences of word "properties" found (dlysnichenko)

Lisnichenko Dmitro 10 years ago
parent
commit
91eb6961ef
1 changed files with 1 additions and 1 deletions
  1. 1 1
      ambari-server/src/main/resources/scripts/configs.sh

+ 1 - 1
ambari-server/src/main/resources/scripts/configs.sh

@@ -178,7 +178,7 @@ doConfigUpdate () {
 doConfigFileUpdate () {
   FILENAME=$1
   if [ -f $FILENAME ]; then
-    if [ "1" == "`grep -n \"\\\"properties\\\"\" $FILENAME | cut -d : -f 1`" ]; then
+    if [ "1" == "$(grep -En ^\"properties\" $FILENAME | cut -d : -f 1)" ]; then
       newTag=`date "+%s%N"`
       newTag="version${newTag}"
       newProperties=`cat $FILENAME`;