How do I run a command when another is on the run? in sh
Go to solution
Solved by Tomsen,
You can't run them all at once, but by adding a single '&' at the end, will put the running command in the background (and will allow the next command to run immediately).
Example:
#! /bin/bash
clear
timeout 60s
xterm -e sh -c "cd /home/minecraftserver/Desktop/test-server/BungeeCord; java -Xmx100M -Xms100M -jar BungeeCord.jar" &
xterm -e sh -c "cd /home/minecraftserver/Desktop/test-server/lobby; java -Xmx785M -Xms785M -jar spigot.jar" &
xterm -e sh -c "cd /home/minecraftserver/Desktop/test-server/factions; java -Xmx785M -Xms785M -jar spigot.jar" &
xterm -e sh -c "cd /home/minecraftserver/Desktop/test-server/plots; java -Xmx785M -Xms785M -jar spigot.jar" &
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now