From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,3d23e99cac09b6aa X-Google-Attributes: gidfee84,public From: mooney@dogbert.cc.ndsu.NoDak.edu (Tim Mooney) Subject: Re: Bourne shell redirection Date: 1996/11/23 Message-ID: <578k6k$q0m@dogbert.cc.ndsu.NoDak.edu>#1/1 X-Deja-AN: 198389729 references: <19961122203200.PAA06969@ladder01.news.aol.com> content-type: text/plain; charset=US-ASCII organization: North Dakota Higher Education Computing Network (NDHECN) mime-version: 1.0 newsgroups: comp.unix.osf.osf1 [posted & cc'ed] In article <19961122203200.PAA06969@ladder01.news.aol.com>, wrote: > Does anyone know of a way to redirect standard out and standard error both > to the > screen and to a file from a bourne shell script? Redirect stderr onto stdout and then pipe both into `tee': cat /etc/passwd /etc/somefilethatdoesntexist 2>&1 | tee screen-output.log Tim -- Tim Mooney mooney@dogbert.cc.ndsu.NoDak.edu Information Technology Services (701) 231-1076 (Voice) Room 242-J1, IACC Building (701) 231-8541 (Fax) North Dakota State University, Fargo, ND 58105-5164