In bash scripts, I have seen codes like this
command &
wait
I am wondering what is there any motivation behind this operation rather than simply run
command
instead.
The motivation of this question comes from this post: bash wait for rsync to finish for proceeding, where the poster chose to use the "wait" method while an unaccepted answer suggests the normal command method.
Although based on my understanding the answer to that post should be correct, I have also seen various other places (including companies and personal projects) where the "background and wait" method is used in practice, so I am getting a bit confused.
Is there any situation where the two codes actually have a difference?