[kde-linux] Clear screen on konsole
Juho Hämäläinen
jusa at hilvi.org
Mon May 4 13:18:31 UTC 2009
On [ Mon 4.05.09 14:55 ], Erbureth wrote:
> >Erbureth escreveu:
> >>
> >> Session numbering should start from 1
> >>
> >> Issusing clear followed by dcop command in the same session worked for me
> >> (tried it from both Konsole and Yakuake).
> >
> >It is working now... Sorry, I must have missed something ;-)
> >
> >Do you know a trick to get my own PID? if I have 2 konsoles opened, I
> >don't want to clear the wrong one...
> >
> The trick is in getting a pid of a parent of your own bash process, which you can get by simple
> ps command with custom formating.
>
> ps -o ppid,fname|grep bash|sed -e s/[^0-9]//g|head -n1
Of course you could also do it _really_ simple, using bash variables $$
(own process id) or $PPID (parent process id). man (and advanced bash
scripting guide [1]) is your friend.
-Juho
[1] http://tldp.org/LDP/abs/html/
More information about the kde-linux
mailing list