Fri, 23/05/2008 - 18:52 — huntly
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
Will keep looking into it
cracked 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