From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22487 invoked from network); 3 Sep 2004 17:02:58 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 3 Sep 2004 17:02:58 -0000 Received: (qmail 91300 invoked from network); 3 Sep 2004 17:02:52 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 3 Sep 2004 17:02:52 -0000 Received: (qmail 15438 invoked by alias); 3 Sep 2004 17:02:10 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7971 Received: (qmail 15428 invoked from network); 3 Sep 2004 17:02:10 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 3 Sep 2004 17:02:10 -0000 Received: (qmail 89743 invoked from network); 3 Sep 2004 17:01:11 -0000 Received: from main.gmane.org (80.91.224.249) by a.mx.sunsite.dk with SMTP; 3 Sep 2004 17:01:10 -0000 Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1C3HQz-0007hy-00 for ; Fri, 03 Sep 2004 19:01:09 +0200 Received: from hippo.asfast.net ([216.182.10.250]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 03 Sep 2004 19:01:09 +0200 Received: from ljz by hippo.asfast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 03 Sep 2004 19:01:09 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: zsh-users@sunsite.dk From: Lloyd Zusman Subject: Re: Making a script 'sourceable' Date: Fri, 03 Sep 2004 13:01:02 -0400 Message-ID: References: <20040903163509.GA12618@DervishD> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@sea.gmane.org Cc: DervishD X-Gmane-NNTP-Posting-Host: hippo.asfast.net User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:6AITYQBdcls+U2juUWIvrB9gLUQ= Sender: news X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=-0.9 required=6.0 tests=BAYES_30 autolearn=no version=2.63 X-Spam-Hits: -0.9 DervishD writes: > [ ... ] > > So I must, by hand, restore any changed variables, options and, > what more? Must I restore any other thing? Is there any simple way of > making scripts source-safe or source-aware? > > Thanks a lot in advance :) > > Raúl Núñez de Arenas Coronado ¡Hola Raúl! Espero que te encuentres muy bien. I'm not sure if this handles the case that you're concerned about, but when I want to make a script "sourceable" as well as executable, I do this: #!/bin/zsh ( # all script stuff goes here ) Yes, it causes an extra fork, but that's the price I pay for this dual sourceable/executable capability. -- Lloyd Zusman ljz@asfast.com God bless you.