Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

function in .bashrc

Status
Not open for further replies.

ovince

Programmer
Feb 27, 2007
55
FR
Hi

I would like to put a function into .bashrc file that would:
open a new Konsole and cd into the result of pwd command. Something like:

pwdinnk() {
p=`echo pwd`
echo $p
`dcop $KONSOLE_DCOP newSession`
`cd $p`
}

This does not work. In details:

1. The echo $p part does not give me back the current path. What is wrong here?

2. this part `dcop $KONSOLE_DCOP newSession` works OK. It opens a new Konsole just as I want

3. The `cd $p` I wrote ad hoc just to present the idea. What would be the proper syntax here?

Could somebody help me on this?

thanks
oliver
 
Replace this:
p=`echo pwd`
with this:
p=`pwd`

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
thanks PHV

Do you have a tip how to change dir?

`cd $p`

does not work in this form


oliver

 
I already tried cd $p but doesnotwork unfortunately
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top