Mailinglist Archive: opensuse (3566 mails)
| < Previous | Next > |
[opensuse] Re: function in .bashrc
- From: Jonathan Arnold <jdarnold@xxxxxxxxxxxx>
- Date: Wed, 25 Apr 2007 14:21:35 -0400
- Message-id: <f0o67g$qql$1@xxxxxxxxxxxxx>
Vince Oliver wrote:
>
> Hi
>
>
> I would like to put a function into .bashrc file that would open a new
> Konsole in SUSE10.2 and cd into the result of the pwd command. Something
> like:
>
> pwdinnk() {
> p=`pwd`
> echo $p
> `dcop $KONSOLE_DCOP newSession`
> cd $p
> }
>
> Everything works except it does not change the directory. `cd $p` does
> not work nither. Do you have some tips?
This will only work from within another Konsole. I found this works from
anywhere:
$ dcop --user $USER konsole-`pidof konsole` default newSession
Assuming that there is a konsole running. So you could first do the pidof to
get the PID of any running konsole (split it apart if there were more than
one, as if two are running you get:
$ pidof konsole
12311 15810
).
If none return, you can just run konsole.
Here's a good link: http://docs.kde.org/userguide/kde-diy.html
As far as send commands to the bash shell running there, I don't know.
--
Jonathan Arnold (mailto:jdarnold@xxxxxxxxxxxx)
Daemon Dancing in the Dark, an Open OS weblog:
http://freebsd.amazingdev.com/blog/
UNIX is user-friendly. It's just a bit picky about who its friends are.
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx
>
> Hi
>
>
> I would like to put a function into .bashrc file that would open a new
> Konsole in SUSE10.2 and cd into the result of the pwd command. Something
> like:
>
> pwdinnk() {
> p=`pwd`
> echo $p
> `dcop $KONSOLE_DCOP newSession`
> cd $p
> }
>
> Everything works except it does not change the directory. `cd $p` does
> not work nither. Do you have some tips?
This will only work from within another Konsole. I found this works from
anywhere:
$ dcop --user $USER konsole-`pidof konsole` default newSession
Assuming that there is a konsole running. So you could first do the pidof to
get the PID of any running konsole (split it apart if there were more than
one, as if two are running you get:
$ pidof konsole
12311 15810
).
If none return, you can just run konsole.
Here's a good link: http://docs.kde.org/userguide/kde-diy.html
As far as send commands to the bash shell running there, I don't know.
--
Jonathan Arnold (mailto:jdarnold@xxxxxxxxxxxx)
Daemon Dancing in the Dark, an Open OS weblog:
http://freebsd.amazingdev.com/blog/
UNIX is user-friendly. It's just a bit picky about who its friends are.
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx
| < Previous | Next > |