Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com From: "Hannu E K Nevalainen \(garbage mail\)" To: "Alex Vinokur" , "ML CygWIN" Subject: RE: bash : stderr & more (pipe for stderr) Date: Sat, 14 Jun 2003 13:47:27 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 In-Reply-To: Importance: Normal > From: cygwin-owner AT cygwin DOT com [mailto:cygwin-owner AT cygwin DOT com]On Behalf > Of Alex Vinokur > How to use pipe for stderr? This is a Bash-question, not cygwin - i.e. off topic here ;-) $ cat t.c #include int main(int argc, char **argv) { if (argc<=1) printf("Use: %s [o] [e]\n" \ " o - print short text on stdout\n" \ " e - print short text on stderr\n",argv[0]); else { if ((argc>1) && (argv[1][0]=='o')) fprintf(stdout,"%s: This text on stdout\n",argv[0]); if ((argc>2) && (argv[2][0]=='e')) fprintf(stderr,"%s: This text on stderr\n",argv[0]); } return 0; } $ gcc t.c $ ls -l a.exe -rwxr-xr-x 1 Hannu 19876 Jun 14 13:02 a.exe* $ a o e 2>&1 | less -- less display -- a: This text on stdout a: This text on stderr -- end -- /Hannu E K Nevalainen, 59~14'N, 17~12'E ~ <=> degree -- --END OF MESSAGE-- -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/