Linux Bash While Function Exit Code

[Solved] Linux Bash While Function Exit Code | Erlang - Code Explorer | yomemimo.com
Question : linux bash while function exit code

Answered by : leonard

while rmdir FOO; ss=$?; [[ $ss -eq 0 ]]
do echo in loop
done
echo "out of loop with ?=$? but ss=$ss"

Source : https://unix.stackexchange.com/questions/676733/need-the-exit-code-of-condition-function-when-a-bash-while-loop-terminates | Last Update : Wed, 28 Sep 22

Question : linux bash while function exit code

Answered by : leonard

check1
while [ $? -eq 1 ]
do # ... check1
done

Source : https://stackoverflow.com/questions/27674687/in-bash-script-how-to-use-function-exit-status-in-while-loop-condition | Last Update : Wed, 28 Sep 22

Question : linux bash while function exit code

Answered by : leonard

if (( $? == 0 ))
then echo 'worked'
fi

Source : https://stackoverflow.com/questions/27674687/in-bash-script-how-to-use-function-exit-status-in-while-loop-condition | Last Update : Wed, 28 Sep 22

Answers related to linux bash while function exit code

Code Explorer Popular Question For Erlang