Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14678 > unrolled thread

Re: exec

Started byGreg Wooledge <wooledg@eeg.ccf.org>
First post2018-09-28 08:28 -0400
Last post2018-09-28 08:28 -0400
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: exec Greg Wooledge <wooledg@eeg.ccf.org> - 2018-09-28 08:28 -0400

#14678 — Re: exec

FromGreg Wooledge <wooledg@eeg.ccf.org>
Date2018-09-28 08:28 -0400
SubjectRe: exec
Message-ID<mailman.1444.1538137711.1284.bug-bash@gnu.org>
On Fri, Sep 28, 2018 at 09:11:26AM +0300, Francis Gathea wrote:
> Same thing in a shell script.
> 
> On 28/09/2018, Francis Gathea <franciskimani04@gmail.com> wrote:
> > Hi. Why is this function closing out my session if typed on the terminal?
> >

First, please do not "top-quote".  When you resond, put your response
UNDER the original text, not ABOVE it.  This isn't a Microsoft Windows
mailing list.

Second, this is what the exec command is designed to do.

wooledg:~$ help exec
exec: exec [-cl] [-a name] [command [arguments ...]] [redirection ...]
    Replace the shell with the given command.
    
    Execute COMMAND, replacing this shell with the specified program.
    ARGUMENTS become the arguments to COMMAND.  If COMMAND is not specified,
    any redirections take effect in the current shell.
    
    Options:
      -a name   pass NAME as the zeroth argument to COMMAND
      -c        execute COMMAND with an empty environment
      -l        place a dash in the zeroth argument to COMMAND
    
    If the command cannot be executed, a non-interactive shell exits, unless
    the shell option `execfail' is set.
    
    Exit Status:
    Returns success unless COMMAND is not found or a redirection error occurs.

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web