我有一个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引发错误。我可以做些什么来让它接受字符串
发布于 2012-08-22 16:35:34
您的elif行中缺少一个空格:
elif [ "$zone" == "B" ]; thenhttps://stackoverflow.com/questions/12069142
复制相似问题