Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to start a few programs with a single launch script and monitor their outputs to the console.

The easiest way would be to launch in background an xterm for each program, but that's not very neat (I don't like having too many windows around).

The other alternative I've thought of is to redirect their outputs to logfiles and then use multitail to watch their outputs in a single terminal, but if I want to kill them I'd need to take a look at their PID's and then issue a kill command rather than just going to their terminal and press Ctrl+C. Also, this wouldn't work well if some of the program uses curses or similar.

My ideal option would be something like using screen to multiplex a terminal (or even show all of them in a split fashion), but I cannot find any option in the manual pages related with that and googling screen won't throw any useful result as it is a very generic term.

So, any suggestions on how to achieve something similar to what I want?

share|improve this question
add comment

2 Answers

It is possible to do this with screen by loading a custom screen configuration file. Here is an example for starting and monitoring four programs in a split terminal. Create a file launch_file somewhere with the following in it:

split
split
split
screen program1
focus down
screen program2
focus down
screen program3
focus down
screen program4

where program1, program2... are the four programs you wish to run. Now, in a (large) xterm or similar enter screen -c launch_file. You should see a four-way split view with one of the programs running in in each. You can use Ctrl+a tab to cycle through the four windows, and use Ctrl+c to stop one of the programs.

share|improve this answer
add comment

No suggestion for your specific problem but have you also considered tmux which is said to be easier to configure. Have a look at this and this blog post for more information and some advantages compared to screen.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.