mardi 9 février 2021

Bash "do" and "then" in new line [closed]

I was wondering about the best or prefered syntax for control structures in bash Bash allows

if condition; then
 do something
fi

and

if condition
then
 do something
fi

As you can see "then" can be in the same line by placing a ";" after the condition. For some reason i find it more readable to put the "then" and "do" key words in a new line, also when i see a ";" it makes me think of a one liner. Is there a best practice for that ?

Best regards

Aucun commentaire:

Enregistrer un commentaire