Table of Contents
Previous Sample | List of Samples | Next Sample

Myecho.c


/***************************************************************************/
/*                                                                         */
/*                                                                         */
/*       A variant of echo that prints quotes around each argument.        */
/* Copyright (c) 1989-1992 by Hamilton Laboratories.  All rights reserved. */
/*                                                                         */
/*                                                                         */
/***************************************************************************/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "internat.h"

void cdecl main ( int argc, char *argv[] )
      {
      int i, length = 0;
      Internationalize();
      for (i = 0;  i < argc - 1; i++)
         {
         length += strlen(argv[i]) + 1;
         printf ("'%s' ", argv[i]);
         }
      length += strlen(argv[i]) + 1;
      printf("'%s'\n", argv[i]);
      printf("arg length = %d characters\n", length);
      exit(0);
      }



Previous Sample | List of Samples | Next Sample
Table of Contents



Copyright © 1988-2003 by Hamilton Laboratories. All rights reserved.