Vince,

Please, please, do not use your mail client's "Reply" command to start 
new topics. It messes up the topic threading for the large number of 
users whose email clients support such things.


On Wednesday 25 April 2007 09:40, 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
> }

What value does KONSOLE_DCOP have?


> Everything works except it does not change the directory. `cd $p`
> does not work nither. Do you have some tips?

The cd command is not sent to the new shell. When you use DCOP to 
manipulate KDE, you're sending a message through a centralized daemon 
that then dispatches or executes the command. Once the dcop command 
returns, you're no longer interacting with the DCOP daemon.

Commands from your "pwdinnk" shell function that follow the dcop 
invocation are interpreted by the same shell as the one that invoked 
pwddinnk.

Furthermore, the backticks around the dcop invocation don't seem to make 
any sense to me. You're telling the shell (the one executing the 
pwdinnk function) to take the output of the dcop command and interpret 
it as a command to execute. I doubt that's what you want, is it?

You should read the BASH manual or some other shell documentation to 
learn what the backtick notation means / does.


Given the indirectness of using DCOP to launch a new Konsole or create a 
new Konsole tab, I think the best you're going to be able to do is set 
up something in your .bashrc that looks for a file (probably in your 
home directory) that, if present, indicates extra start-up commands to 
execute. If present, it sources ("source", a.k.a. the "." command, is a 
shell built-in, which you should understand) that file and then removes 
it (to prevent it from being acted on by subsequently started shells).


> thanks
> oliver


Randall Schulz
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to