Create a script like this:
|
Source code
|
1
2
3
4
5
6
|
konsole --script -e man ls &
sleep 5
KONSOLE=`dcop | grep konsole | tail -n 1`
SESSION=`dcop $KONSOLE konsole newSession`
sleep 1
dcop $KONSOLE $SESSION sendSession "man cd"
|
It opens initially a console a with the
man ls command. Then, it creates with DCOP a new session and then it feeds the newly created session with the
man cd command.
The sleep commands are required because the successive DCOP commands are not immediately available, but after some timeout. For example, I gave Konsole 5 seconds the time to start, so that the command newSession is available by that time.
Of course you can tweak this as much as you want, but this is the idea.