SUMMARY: sh syntax

From: Guenter Millahn (gm@informatik.tu-cottbus.de)
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
(2>&1).

Thanks to all the people who answered so fast:
perryh@pluto.rain.com (Perry Hutchison)
Nate Itkin <Nate-Itkin@ptdcs2.intel.com>
poffen@San-Jose.ate.slb.com (Russ Poffenberger)
satmb@gauss.med.harvard.edu (Timothy Baum 432-2765)
syd@dsinc.myxa.com (Syd Weinstein)
Daniel Pommert <daniel@lternet.edu>
D.G.Jones@scuna.dircon.co.uk (Derek Jones)
chip@eniac.seas.upenn.edu (Charles "Chip" Buchholtz)
cammaa@mcsunx.gs.com (Aaron Cammarata)
ericb@telecnnct.com (Eric William Burger)
odt@lci.com (Dan Transue)
john@oncology.uthscsa.edu (John Justin Hough)
stuart@TO.mobil.com (Stuart Pearlman - RDR)
reggie@rentec.com (Reggie Dugard)

Guenter

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