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 have a bash script that spins off three processes like this:

CD FOO_DIR && ./run-foo
CD BAR_DIR && ./run-bar
CD BAZ_DIR && ./run-baz

I want a tool that splits the parent shell into three sections (horizontally or vertically -- there's no difference) and shows the output of each child process in each section respectively.

Does such a tool exist?

share|improve this question
    
Not to my knowledge. Can you use screen(1) and run each in a different tab? Or in different tabs in a terminal? A sneaky way of doing it would be to run several shells inside emacs in windows split vertically... –  vonbrand Mar 1 '13 at 2:33

2 Answers 2

As has been said, screen should suit your needs.

Create a screen configuration file that looks like this:

startupmessage off
split
split

screen -t top top                       # -t <title> <command>
screen -t netstat watch netstat -tanp 
screen -t date watch date 

select top # In the first screen show the screen titled 'top'

focus down # Focus down to next screen
select netstat # Show screen titled 'netstat'

focus down # Focus down to the next screen
select date # Show the screen titled date

Let's call this file screen_run. Then simply run screen. The -c option specifies the configuration file to use :

screen -c screen_run

If you want vertical splits, you should be able to use split -v in place of split.

See https://www.gnu.org/software/screen/ for more information.

share|improve this answer

In addition to screen, you may want to check out tmux as well. Each has its strengths and weaknesses, and you may prefer one's handling of splits over the other's.

share|improve this answer

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.