0403-012测试命令参数无效

时间:2019-05-22 09:13:57

标签: shell

在if语句中使用大括号的问题。

fileResult=`rsh $nsmHost "find $keyPackagePath -name '*.pgp' -exec ls -ltr '{}' +" | awk '{print $9}' | sort -k1.32`

for i in $fileResult
  do
    #Extract Minor Version and Major version
    keyMajVersion=`echo $i|cut -d '.' -f2 | cut -c19-`
    keyMinVersion=`echo $i|cut -d '.' -f3 | cut -d '_' -f1`

    if [ -f $versionFile ]
    then
      majVersion=`cat $versionFile|cut -d '.' -f1`
      minVersion=`cat $versionFile|cut -d '.' -f2`

      if [ [ $keyMajVersion == `echo "$majVersion + 1" | bc` ] && [ $keyMinVersion = `echo "$minVersion + 1" | bc` ] ] || [ [ $keyMajVersion = $majVersion ] && [ $keyMinVersion" = `echo
 "$minVersion + 1" | bc` ] ]
      then
        #install and Activate
        #triggerPollNDeploy
        echo "KUM::Version file exist and support next package deploy"
        #Update version in VersionFile and break
        echo "$keyMajVersion.$keyMinVersion" > $versionFile
       fi

0 个答案:

没有答案