【发布时间】:2020-04-13 01:42:25
【问题描述】:
谁能帮我弄清楚这个脚本有什么问题? 我是初学者
echo "whats the server address ?"
read server
ping -c 4 $server > /dev/null
result=$?
if [ $result = 0 ]
echo " ping succ"
else echo "ping unsuccessful" fi
【问题讨论】:
-
它怎么不适合你?如果您不告诉我们您有什么错误或问题,我们将无法解决您的问题。但对于初学者来说,
if语法是错误的。搜索“bash if else”。 -
请描述错误是什么。
标签: bash if-statement syntax