Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个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引发错误。我该怎么做才能让它接受字符串
.abc.def.com
您的elif行中缺少一个空格:
elif
elif [ "$zone" == "B" ]; then