Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Mar 2001 18:57:00 -0600
From:      "Christopher Leigh" <clcont@gmx.net>
To:        <lucas@slb.to>
Cc:        <freebsd-questions@freebsd.org>
Subject:   Re: uhm. why isn't there a vigr for freebsd?
Message-ID:  <005801c0b0d8$ac851040$ca83a7d8@king1>
References:  <200103190333.f2J3XDe33615@grumpy.dyndns.org> <000f01c0b02f$191482e0$fa87a7d8@king1> <20010319120014.A3274@billygoat.slb.to>

next in thread | previous in thread | raw e-mail | index | archive | help
thank you again.

so. is there a way to get it to waste less memory?


----- Original Message -----
From: Lucas Bergman <lucas@slb.to>
To: Christopher Leigh <clcont@gmx.net>
Cc: <freebsd-questions@freebsd.org>
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?005801c0b0d8$ac851040$ca83a7d8>