瀏覽代碼

add break conditions for select

Grega Bremec 7 月之前
父節點
當前提交
8fd8e3fe34
共有 2 個文件被更改,包括 4 次插入0 次删除
  1. 2 0
      code/get-logs.sh
  2. 2 0
      code/remove-logdirs.sh

+ 2 - 0
code/get-logs.sh

@@ -16,6 +16,8 @@ if [ -e "${MYDIR}/producer.log" ] || [ -e "${MYDIR}/consumerl.log" ]; then
         if [ "${resp}" = "N" ]; then
             echo "Exiting."
             exit 0
+        elif [ "${resp}" = "Y" ]; then
+            break
         fi
     done
     rm -f "${MYDIR}/producer.log" "${MYDIR}/consumer.log"

+ 2 - 0
code/remove-logdirs.sh

@@ -14,6 +14,8 @@ select resp in "Y" "N"; do
     if [ "${resp}" = "N" ]; then
         echo "Exiting."
         exit 0
+    elif [ "${resp}" = "Y" ]; then
+        break
     fi
 done