bash脚本中的pdsh

时间:2012-08-22 08:30:22

标签: linux bash

我有一个bash脚本,如下所示,

#!/bin/bash
zone=$1
if  [ "$zone" == "A" ]; then
    pdsh -l abc -w server[01-12] 'sudo abc stop'
elif ["$zone" == "B" ]; then
    pdsh -l abc -w server[1-12].abc.def.com 'sudo abc stop'
fi

服务器字符串.abc.def.com引发错误。我该怎么做才能让它接受字符串

1 个答案:

答案 0 :(得分:2)

您的elif行中缺少空格:

elif [ "$zone" == "B" ]; then