-1

最初のオプションは開始し、2番目はサービスを停止するメニューを作成しました。3番目に開発したいのは、サービスが最初に停止され、次に20秒の休憩があり、その後サービスが停止する再起動です。再起動オプションについて、コードが正しいかどうかを教えてください.1、2、3、20 のように逆カウントを表示するストップダウン ウォッチも表示する必要があります。サービスの開始と表示されます

echo "Please enter the appropriate choice for doing the operations"
    echo "
    1) STOP Services        
    2) START Services 
    3  RestartServices Within 20 seconds
case $choice in
    1)
        echo "*************Stopping Services**************"
        stopAll.sh
        ;;
    2)
        echo "*************Starting Services**************"
        startAll.sh
        ;;
    3)
        echo "*************Restarting services within 20 Seconds*************"
        stopAll.sh
        sleep 20 seconds  //please avise is this this correct way  to sleep the services for 20 seconnds..??////
        startAll.sh

        ;;
4

1 に答える 1

1

スリープマンページから:

名前

  sleep - delay for a specified amount of time

あらすじ

  sleep NUMBER[SUFFIX]...
  sleep OPTION

説明

  Pause for NUMBER seconds.  SUFFIX may be 's' for seconds (the default),
  'm' for minutes, 'h' for hours or 'd' for days.  Unlike most  implemen‐
  tations  that require NUMBER be an integer, here NUMBER may be an arbi‐
  trary floating point number.  Given two or more  arguments,  pause  for
  the amount of time specified by the sum of their values.

使用したいと思うでしょうsleep 20ss、デフォルトなのでうまくいくsleep 20はずです。

于 2013-09-22T09:27:39.870 に答える