Commands run concurrently?

Is there a way for vlc to play at the SAME time while the other commands are executing?

vlc --play-and-exit /usr/share/sounds/My_Sounds/Relax.mp3
gxmessage -fg red -font  'sans 50' -timeout 3 -geometry 1800x200 ' BACKING UP FILES FOR UBUNTU_MATE 16.04.3 LTS'
# Backup bookmarks file  
cd /home/andy/.mozilla/seamonkey/4e39n1np.default/
cp -u -f bookmarks.html /media/andy/MAXTOR_SDB1/Linux_Files/
zip -u ~/Documents/Ubuntu_Documents.zip *.html

You can start it as a background process by adding & at the end of the command:

vlc --play-and-exit /usr/share/sounds/My_Sounds/Relax.mp3 &
2 Likes

Thanks, it works great.

Bonus tip – if you need the script to let these background tasks finish, run this command:

wait

For example:

command1 &
command2 &
wait
command3
command4

1 and 2 will run and will not continue until they’ve both exited, then it’ll run 3 and 4 one after the other.

Without the wait, it would be 1 and 2 running in the background, then 3 and 4 will immediately run in the foreground.

thanks, I will add those to my Ubuntu tips file.