Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Apr 2006 17:45:19 -0400
From:      Bill Moran <wmoran@collaborativefusion.com>
To:        "Jonathan Herriott" <herriojr@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: C Program to execute programs in same console
Message-ID:  <20060403174519.4d478a95.wmoran@collaborativefusion.com>
In-Reply-To: <6a56d69c0604031439o7c2eed8an5710dad733a0e97@mail.gmail.com>
References:  <6a56d69c0604031439o7c2eed8an5710dad733a0e97@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 3 Apr 2006 21:39:11 +0000
"Jonathan Herriott" <herriojr@gmail.com> wrote:
> 
> I've come into an interesting problem I've been trying to figure out. 
> For no other reason than my own interest, I've been trying to get a c
> program to execute other programs in the current console I am in
> (using kde if that helps).
> 
> I tried using system() and execvp() calls to try and execute a cd
> command in my current shell, which of course, didn't work.  It seems
> to open up a new shell, then execute the command, and then exit that
> new shell it had opened.
> 
> So, my question is how can I get it to execute a cd in the current
> shell using c code.  You don't have to give me the code, just give me
> a term to search for or a function to look up.  I'm sure someone knows
> how to do it here!

Unless I'm misunderstanding your question, "man 2 chdir" should help out.

-- 
Bill Moran
Collaborative Fusion Inc.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060403174519.4d478a95.wmoran>