echo to stderr

From: Bill Verzal (BVerzal@KOMATSUNA.COM)
Date: Tue Aug 19 2003 - 12:14:20 EDT


Can anyone tell me of a way to write to stderr without a redirect ?

So far, I have this C program I wrote called "Echo" :

/*
* Use: printerr: print stuff to stderr
*/
#include <stdio.h>
main(int argc,char *argv[] ){
     if(argc==2) {
         fprintf(stderr,"%s\n",argv[1]);
         exit(0); }
     else
     {
         fprintf(stderr,"usage: %s [Some Text] - Print [Some Text] to
stderr\n",
             argv [0]);
         exit(1);
     }
}

BV
--------------------------------------------------------

Bill Verzal
AIX Administrator, Komatsu America
(847) 970-3726 - direct
(847) 970-4184 - fax



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:17:08 EDT