📜  bash 跳转到 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:51:35.835000             🧑  作者: Mango

代码示例2
#!/bin/bash

read -p 'Input something > ' one_thing

while true; do
  read -p 'Input something else > ' another_thing

  # Write some code to check if the requirements are met
  # Let's say in this case they are when the variable `thing_to_work` equals `done`

  if [[ "${thing_to_work}" == 'abcde' ]]; then
    break # Exit the loop
  else
    echo 'The requirements were not met, so the loop will start again'
  fi
done