Suppose I have the following two scripts:
#!/bin/sh
while true
do
#Do something
sleep 1m
done
and
#!/bin/sh
while true
do
#Do something else
sleep 1m
done
called First.sh
and Second.sh
respectively.
Now I want to create a script called Start.sh
which would run both of them at the start of the computer:
#!/bin/sh
/path/to/files/First.sh
/path/to/files/Second.sh
The problem with the above is: First.sh
runs forever and Second.sh
never gets executed. Second.sh
runs only after I kill First.sh
. How to start them both simultaneously?
p.s.: In place of First.sh
one could have put chromium-browser
in Start.sh
. Second.sh
wouldn't start unless chromium-browser
is killed.
Put `&˙ at the end of each line and both scripts will run in background independently of each other: