[kde-linux] Executing bash scripts - redux

Robin Atwood robin at binro.org
Wed Aug 12 09:59:28 UTC 2009


On Wednesday 12 August 2009, James Richard Tyrer wrote:
> Robin Atwood wrote:
> > About 18 months ago you guys helped me with an KDE3 app I developed where
> > I needed to execute and capture the output of bash init scripts:
> > http://lists.kde.org/?l=kde-devel&m=120488838806612&w=2
> >
> > Now I have updated it to KDE4 and currently have an embedded konsole part
> > using code copied from the kateconsole plugin. What I have working is a
> > shell made by "TerminalInterface::showShellInDir()" and I send it
> > commands with the "sendInput()" method. This works but I don't want the
> > user to have access to the shell prompt, what I need is a read-only shell
> > that only displays the output of the commands. I tried
> > "startProgram( "/bin/sh", script )" but then the widget just closes.
> > Anybody know the trick to this? I know KDevelop has something like this
> > but doesn't seem to use the TerminalInterface when I searched.
>
> There seems to be something very wrong with the website, but there is
> corresponding documentation pages for 4.x:
>
> http://api.kde.org/4.x-api/kdelibs-apidocs/interfaces/html/classTerminalInt
>erface.html

I had already found that and discovered the hard way that the example is very 
out of date. ;) The kate console plugin source is the best reference for this 
stuff. Anyway I now have a reasonable solution to my problem using a shell and 
a wrapper script. 

Thanks anyway. :)
-Robin
-- 
----------------------------------------------------------------------
Robin Atwood.

"Ship me somewheres east of Suez, where the best is like the worst,
 Where there ain't no Ten Commandments an' a man can raise a thirst"
         from "Mandalay" by Rudyard Kipling
----------------------------------------------------------------------











More information about the kde-linux mailing list