我正在尝试在 bash 中进行直到仿真,但没有工作。代码如下
# an emulation of the do-until loop
do_stuff() {
echo "Enter password"
read password
if [[ $password != "theflow" ]]
then
echo " Sorry, try again."
fi
}
do_stuff
until (( $password == "theflow" ))
do
do_stuff
done