SUMMARY: sh syntax

From: Guenter Millahn (
Date: Sat Jul 09 1994 - 10:59:11 CDT

Hi Sun-Managers.
Here is the abstract of the replies to my request.

My orig posting was:

> I try to understand some sh shell scripts with the following
> constructs:
> > exec </dev/null >$errfile 2>&1
> > ...
> > exec </dev/null >/dev/null 2>&1
> Is there anybody who can explain what it means?

I read the manpage but I couldn't understand this: `exec </dev/null'

> The "</dev/null" means to supply the stdin stream from /dev/null, presumeably
> to provide some default input to the program be exec'd. (Russ Poffenberger)

> This closes standard input by redirecting to read from /dev/null
> (the standard empty file), ... (Timothy Baum)

> From now on, stdin is redirected to /dev/null; reading from stding
> will always return EOF. (Charles "Chip" Buchholtz)

The second part `> xxx 2>&1' is better documented in the manpage. It means
the redirection of stdout to the file xxx while stderr is merged into stdout

Thanks to all the people who answered so fast: (Perry Hutchison)
Nate Itkin <> (Russ Poffenberger) (Timothy Baum 432-2765) (Syd Weinstein)
Daniel Pommert <> (Derek Jones) (Charles "Chip" Buchholtz) (Aaron Cammarata) (Eric William Burger) (Dan Transue) (John Justin Hough) (Stuart Pearlman - RDR) (Reggie Dugard)


Guenter Millahn                       Cottbus University of Technology
Systems and Network Administrator     Computer Science Institute
Voice: +49 (355) 69-2711              P.O. Box: 10 13 44
Fax:   +49 (355) 69-2766              D-03013 Cottbus          GERMANY

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:09:05 CDT