Bhawan Posted March 23, 2010 Posted March 23, 2010 (edited) Hi all, I have been trying to write a simple script to automate some tasks but i have hit a point where I just can't figure this out. I want to run multiple commands simultaneously in foreground (in different console windows) so somewhat like this: konsole command1 konsole command2 konsole commant3 but the problem is that it waits for the first command to finish before executing the second one but the commands do not end (the aren't supposed to) and so it never starts the next command because it waits for the first command to finish and it never finishes. I have also tried this: konsole command1 & konsole command2 & konsole command3 however, this doesn't work for me either because this makes em all run in background and not in foreground. I just want it to run all those commands in foreground so can you guys please help me with this. Thanks Edited March 23, 2010 by Bhawan Quote
Charles Posted March 23, 2010 Posted March 23, 2010 I don't know of an way to do that. You could probably just write up a script for each command and then run it in a separate konsole window. Quote
digip Posted March 23, 2010 Posted March 23, 2010 Create a script for each command, then in a new script, start all of them with the & at the end of the line and they should all run in the background. To see them in a console, I think you just type jobs, then it gives you a # and the script name. You can then do fg # to bring it to the front. http://linuxreviews.org/beginner/jobs/ ex: launch.sh #!/bin/bash script1 & script2 & script3 & script4 & Quote
Bhawan Posted March 25, 2010 Author Posted March 25, 2010 (edited) Create a script for each command, then in a new script, start all of them with the & at the end of the line and they should all run in the background. To see them in a console, I think you just type jobs, then it gives you a # and the script name. You can then do fg # to bring it to the front. http://linuxreviews.org/beginner/jobs/ ex: launch.sh #!/bin/bash script1 & script2 & script3 & script4 & Thank you very much :D I'll give it a shot when I finish my homework. BTW: Is there a way I can filter out the job id for a specific process and then copy that to a variable so that later on i can just go " fg $VARIABLE " ? thanks Edited March 25, 2010 by Bhawan Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.