All pastes #387359 Raw Edit

Miscellany

public c v1 · immutable
·published 2007-03-09 09:02 UTC
rendered paste body
intmain( int argc, char *argv[] ) {	/* uses getopts to check for "b:t:" optstring then	 * comes here.	 */ 	for ( int i = 0; i < argc; i++ ) {		fp = fopen( argv[i], "r" );		if ( fp == NULL )			err( 1, "File does not exist or could not be opened "			"for reading -- %s", optarg );	}	/* When no optionss given it calls readall */}static void readall( FILE *fp, int lncnt ) {	while ( (lncnt = fgetc( fp )) != EOF ) {		printf( "%c", lncnt );	}}_________________Here is my setupTerry@Dixie$ echo $PATH                                                    8:56/usr/home/Terry/sh:/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/binTerry@Dixie$ which rf                                                      8:56/usr/home/Terry/sh/rfTerry@Dixie$ ls | grep *.c                                                 8:56Style_Guide.cStyle_Guide.c_bakTerry@Dixie$ rf Style_Guide.c                                              8:56rf: File does not exist or could not be opened for reading -- (null): No such file or directoryIf I run it through my debugger and set args to Style_Guide.c it reads the file out as normal. If I use ether$ ~/sh/rf Style_Guide.c it works just fine.~/sh holds personal shell scripts and binaries.