start a command in a new tab?


Hi guys,

           Im trying to find a solution to write a shell script that will open up a new tab in Konsole and then run a command on the new tab.   I mean, im not too fussed about konsole, if anyone has somthing working for the default gnome terminal then i dont mind using that terminal.  

Basically the end result is to have a script that will open up 3 tabs in the terminal and have them show the output logs for 2 different tomcat instances and then the 3rd tab to have the apache error log open.

Cheers

Huntly

wee update

Ive been playing about with a script on the net for konsole, but no joy.  Tried looking into the gnome terminal as well, but apparently, from what ive looked at on the net, there is a well known bug that wont allow the "--tab-with-profile-internal-id=PROFILEID " flag/switch.

Will keep looking into it 


cracked it

Managed to use dcop to send msges to new sessions (tabs) in konsole, if anyone is interested, this is how to do it

#!/bin/sh
# open a new konsole window
konsole=$(dcopstart konsole-script)

#open a new tab
session=$(dcop $konsole konsole newSession)

sleep 1

#rename the tab
dcop $konsole $session renameSession catalina_out_logs

sleep 1

#fire off the command to the new window
dcop $konsole $session sendSession "tail -f /var/tomcat6/logs/catalina.out"

You can repeat the process as many times as you want with differnt tabs. 

I had to include the sleeps as the commands wern't running without them, i had to hit enter in every seperate tab to get them to run.  

n1111ce

Well done dude, you've been persistent on getting this working man ;-)

Arron M Finnon
President
Abertay Linux Society