Am Mittwoch 08 August 2018 schrieb J. Fahrner:
> Am 2018-08-08 02:42, schrieb Steve Litt:
> > ======================================
> > #!/bin/sh
> > exec 2>&1
> > exec unbound -p -dd
> > ======================================
>
> Can you explain this strange construct? An exec without a command but
> with i/o redirection? Normally a script ends at the first exec.
>
> Why not simply
>
> exec unbound -p -dd 2>&1 ?

See especially the last sentence.

$ 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.

For all commands in the script following "exec 2>%1" stderr is redirected to 
stdout.

Kind regards,
Stefan
_______________________________________________
Dng mailing list
[email protected]
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng

Reply via email to