From owner-freebsd-questions@FreeBSD.ORG Fri Nov 26 17:08:05 2004 Return-Path: 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 E48B016A4CE for ; Fri, 26 Nov 2004 17:08:05 +0000 (GMT) Received: from ms-smtp-01-eri0.texas.rr.com (ms-smtp-01.texas.rr.com [24.93.47.40]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5937143D55 for ; Fri, 26 Nov 2004 17:08:05 +0000 (GMT) (envelope-from afabian@austin.rr.com) Received: from turingmachine.mentalsiege.net (cs70112247-52.austin.rr.com [70.112.247.52])iAQH7uYm018632 for ; Fri, 26 Nov 2004 11:08:00 -0600 (CST) Received: from turingmachine.mentalsiege.net (turingmachine.mentalsiege.net [127.0.0.1])iAQH7FiF094704 for ; Fri, 26 Nov 2004 11:07:19 -0600 (CST) (envelope-from afabian@turingmachine.mentalsiege.net) Received: (from afabian@localhost)iAQH7DEI094698 for freebsd-questions@freebsd.org; Fri, 26 Nov 2004 11:07:13 -0600 (CST) (envelope-from afabian) Date: Fri, 26 Nov 2004 11:06:56 -0600 From: Adam Fabian To: freebsd-questions@freebsd.org Message-ID: <20041126170656.GB93504@turingmachine.mentalsiege.net> Mail-Followup-To: freebsd-questions@freebsd.org References: <41A615CE.6010405@Silver-Lynx.com> <19861fba0411251005265ecb91@mail.gmail.com> <41A62A68.8050201@Silver-Lynx.com> <41A7568F.3000906@Silver-Lynx.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41A7568F.3000906@Silver-Lynx.com> User-Agent: Mutt/1.5.6i X-Virus-Scanned: Symantec AntiVirus Scan Engine Subject: Re: shell programming challenge X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Nov 2004 17:08:06 -0000 On Fri, Nov 26, 2004 at 09:15:11AM -0700, Don Wilde wrote: > > > > >If you have the option to modify it, ensure that your script exits via > >"exec sh". Alternatively a wrapper that does this is straightforward to > >build. > > > It's looking more and more that I need to make a temporary file that > packages both the init file and the program command line (eval > "blah...") before running. These will not be just shell scripts, they > will be tool programs and x applications. Didn't want to do that because > of the risk of leaving junk in /tmp. It's really socially-acceptable to leave junk in /tmp. /tmp is a volatile dumping ground with no guarantee of file suvival for any length of time, that may even be cleaned on reboot. I played with this for a while, and I have a suspicion that maybe you could use /dev/fd/3 and start bash with something like --rc-file /dev/fd/3 and not close tha standard input, but it's not possible, or I couldn't quite pull it off. (I suspect the latter.) The only other option I can think of involves a temporary file of sorts, too. You could use a FIFO, and then the contents of the "temporary file" wouldn't be left on the disk, but you'd still have the FIFO to deal with. You may also be trying to do something complex enough that it's just more trouble than it's worth to do it with shell programming. Anyway, good luck. -- Adam Fabian (afabian@austin.rr.com)