我是Linux Shell Scripting的新手,想知道是否有人可以帮我解决以下问题.
我创建了一个脚本来与我的linux机器同步时间,但只有一个exec命令似乎完成
#!/bin/bash
#Director SMS Synch Time Script
echo The current date and time is:
date
echo
echo Synching GTS Cluster 1 directors with SMS.
echo
echo Changing date and time for director-1-1-A
exec ssh root@128.221.252.35 "ntpd -q -g"
echo Finished synching director-1-1-A
echo
sleep 2
echo Changing date and time for director-1-1-B
exec ssh root@128.221.252.36 "ntp -q -g"
echo Finished synching director-1-1-B
echo
sleep 2
echo Finished Synching GTS Cluster 1 directors with SMS.
sleep 2
echo …Run Code Online (Sandbox Code Playgroud) shell ×1