A Simple Linux Bash Script

Asked by Julianloui

How can I run two applications concurrently in my following simple script? It makes sense that Bash lets me run only the first application. How can I continue to the next command without first ending the currrent one?

Julianloui

#! /bin/bash
#
totem mozart.mp3
shotwell turtle.jpg
killall -9 totem
killall -9 shotwell

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu bash Edit question
Assignee:
No assignee Edit question
Solved by:
Julianloui
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

You will need to change

totem mozart.mp3
shotwell turtle.jpg

to

totem mozart.mp3 &
shotwell turtle.jpg &

This will background the process and allow the next to run straight after. Without it, the script will wait til totem is closed, then run the next process. This then also has to be closed to run the next command and so forth. as you have not specified the files absolutely, you will need to run the command whilst in the same folder as both files.

Revision history for this message
Julianloui (julianloui) said :
#2

Andrew,

Thank you very much for your great help.

Julianloui

Revision history for this message
Midnight Matt (randygaffer) said :
#3

Plus, if at anytime you want to move a process to the background while it's running, first hit ^Z (Control-Z), you'll then see the word `Suspended`. Then enter the letters `bg` at the prompt. You should then see the command you've just moved to the background w\ an ampersand appended.