[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: exec, stdin, stdout, stderr



"David Berg" <drberg1000@gmail.com> writes:

> I'm trying to read a bash script and fortunately am confused at the
> first non comment line.
>
> looking at:
>
> exec < /dev/null
> test -t 1 || exec > /dev/null
> test -t 2 || exec 2>&1
>
> I think I understand most of it but can't figure out what `exec`
> called without any arguments will do.  Does it simply replace the
> shell with a copy of itself?

Can't remember the exact semantics (whether it's a special case or
not) but essentially this just redirects the *current* process'
std streams.

A new process is not created.


Nic



Reply to: