From owner-freebsd-questions@FreeBSD.ORG Mon Apr 3 21:39:15 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BC46816A422 for ; Mon, 3 Apr 2006 21:39:15 +0000 (UTC) (envelope-from herriojr@gmail.com) Received: from nproxy.gmail.com (nproxy.gmail.com [64.233.182.190]) by mx1.FreeBSD.org (Postfix) with ESMTP id D907043D49 for ; Mon, 3 Apr 2006 21:39:14 +0000 (GMT) (envelope-from herriojr@gmail.com) Received: by nproxy.gmail.com with SMTP id m18so496459nfc for ; Mon, 03 Apr 2006 14:39:13 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=NyPjBUkDn0mIQKc1S7jdv4gfqa4003w1KoPyKwPMqVN2J5x5WWKwEpNPbdmwfHdBqyYpng2MXg7vgvdpyCoxEbjeRxy/69HBMghnVcV+SxurwFqSP/DMyE5kVyx6EcwaQqlK/baTp16eDGOjP3jMozmeZmvnOyEtcIvKhMyNJjA= Received: by 10.49.3.10 with SMTP id f10mr398446nfi; Mon, 03 Apr 2006 14:39:12 -0700 (PDT) Received: by 10.49.29.3 with HTTP; Mon, 3 Apr 2006 14:39:11 -0700 (PDT) Message-ID: <6a56d69c0604031439o7c2eed8an5710dad733a0e97@mail.gmail.com> Date: Mon, 3 Apr 2006 21:39:11 +0000 From: "Jonathan Herriott" To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Subject: C Program to execute programs in same console X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Apr 2006 21:39:15 -0000 Hi! I've come into an interesting problem I've been trying to figure out.=20 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! Thanks in advance for the help! Jon