The while loop — The while-loop is relatively simple in what it does: it executes the command list<LIST1> and if the exit code of it was 0 (TRUE) it executes <LIST2>. This happens again and again until <LIST1> returns FALSE.

while <LIST1> ; do
<LIST2>
done

The until loop — The until-loop is relatively simple in what it does: it executes the command list<LIST1> and if the exit code of it was not 0 (FALSE) it executes <LIST2>. This happens again and again until <LIST1> returns TRUE.

until <LIST1> ; do
<LIST2>
done

Running Bash Scripts

The script should have execute permission for the correct owner for running. we can change the permission using chmod

chmod u+x script.sh

Defining which shell to run,

#!/bin/bash

We need to give the proper permission to the script before running it.