#!/bin/bash
branch=$1
vcva=$2
esx=$3
pxe=$4
setup=$5
#If branch is Vsphere-2015
if [ "$branch" == "vsphere2015"];then
echo " Running Bats for Vsphere-2015 with the following details ."
if [ ! "vcva" ];then
echo "VCVA Build is $2 "
echo "ESX Build is $4 "
echo "pxe info is $5 "
#If all the setups has to be run
setup=$5
case "$setup" in "all")
echo "runnning all setups on Vsphere-2015."
vpshere2015_primary
vpshere2015_M1N1
vpshere2015_M2N1 =======> these are methods
vpshere2015_legacy
;;
我是新來的外殼及這段代碼後得到越來越語法錯誤的情況下,聲明殼
bat.sh:第38行:附近意外的標記newline' 'at.sh: line 38:
語法錯誤;;
我想運行取決於在命令行由用戶給定的輸入一些功能
您還需要關閉'之前有空格]' - '[「$ branch」==「vsphere2015」]'應該是'[「$ branch」==「vsphere2015」]''。原因:'['命令要求其最後一個參數必須是']',並且參數之間用空格分隔。 – 2014-09-30 12:17:11