From owner-freebsd-questions Mon Mar 19 16:57:12 2001 Delivered-To: freebsd-questions@freebsd.org Received: from shorts.nts-online.net (dns2.nts-online.net [216.167.161.36]) by hub.freebsd.org (Postfix) with ESMTP id 3DFB537B737 for ; Mon, 19 Mar 2001 16:56:55 -0800 (PST) (envelope-from clcont@gmx.net) Received: from king1 (dialup-lbb-0202.nts-online.net [216.167.131.202]) by shorts.nts-online.net (8.11.0/8.11.0) with SMTP id f2K0mYO15065; Mon, 19 Mar 2001 18:48:35 -0600 Message-ID: <005801c0b0d8$ac851040$ca83a7d8@king1> From: "Christopher Leigh" To: Cc: References: <200103190333.f2J3XDe33615@grumpy.dyndns.org> <000f01c0b02f$191482e0$fa87a7d8@king1> <20010319120014.A3274@billygoat.slb.to> Subject: Re: uhm. why isn't there a vigr for freebsd? Date: Mon, 19 Mar 2001 18:57:00 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG thank you again. so. is there a way to get it to waste less memory? ----- Original Message ----- From: Lucas Bergman To: Christopher Leigh Cc: Sent: Monday, March 19, 2001 12:00 PM Subject: Re: uhm. why isn't there a vigr for freebsd? > > i still like typing vigr. (linux spoils me...) > > Whatever. > > > i guess > > > > #!/bin/sh > > vi /etc/group > > > > will have to suffice. :) > > > > any security concerns in doing that? > > Good enough. No security problems unless the script is setuid, > setgid, or something like that. > > > could i do > > > > #!/bin/sh > > exec vi /etc/group > > Yes. > > > what's the difference? > > The second method saves one process. In the first example, you have > > (1) /bin/sh process (say, x) starts, taking commands from your script > (2) process x starts a new process y, which runs 'vi' > (3) when you're done editing, process y exits > (4) process x looks for more commands, hits end of file, so process x > exits > > In the second example, you have > > (1) /bin/sh process (say, x) starts, taking commands from your script > (2) process x runs 'vi' (no new process is created) > (3) when you're done editing, process x exits > > To use some lingo, using the 'exec' shell builtin means the current > shell's process is *replaced* with the command that follows. Clearly, > this implies no further commands in the script get executed after an > 'exec' is run. See this by running > > #! /bin/sh > exec echo first > echo second > > > ty. > > yw. > > Lucas > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message