home *** CD-ROM | disk | FTP | other *** search
- /* copyright (c) 1982 Peter Baker */
-
- /* multiple space from an input file to the standard output */
- /* ms -n infile */
-
- #include <stdio.h>
-
- main( argc, argv )
- int argc;
- char **argv;
- {
- FILE fd;
- int i, n;
- char c;
-
- if( argc != 3 )
- {
- printf( "\nUsage: ms -n infile \n" );
- exit( 1 );
- }
- if( ( fd = fopen( argv[2], "r" ) ) == NULL )
- {
- printf( "\nms can't open %s for reading\n", argv[2] );
- exit( 2 );
- }
- n = atoi( argv[1]+1 );
- while( ( c = getc( fd ) ) != EOF )
- {
- putchar( c );
- if( c == '\n' )
- {
- for( i = 1 ; i < n ; i++ )
- putchar( '\n' );
- }
- }
- }
- toi( argv[1]+2 );
- else
-