Bug in 4.2 C compiler?

Tom Kessler tomk at ur-laser.uucp
Fri Aug 24 00:06:46 AEST 1984


#include<stdio.h>
#include<math.h>
#include<sys/wait.h>

int dim_data[1][2]={ {250,250} };

char *aperatures[1]= { "1 1 4 a 4 a" };


main()
{
int speed;
char command[64],foo[64];


	 sprintf(command, "scanregion -da %s  %d %d %d /dev/null",aperatures[0],
		  dim_data[0][0], dim_data[0][1], speed );
	 sprintf( foo,"echo \"%s \" >>result",command);
	 printf("%s\n", foo);
	 sprintf( foo, "time %s >>result 2>&1",command);
	 printf("%s\n", foo );
}

this Program produces the following output:

echo "scanregion -da 1 1 4 a 4 a  250 250 0 /dev/null " >>result
time  >>result 2>&1


I believe it should produce something like:

echo "scanregion -da 1 1 4 a 4 a  250 250 0 /dev/null " >>result
time scanregion -da 1 1 4 a 4 a  250 250 0 /dev/null >>result 2>&1

Any ideas why this might not be so?
These are from a sun-150 with the Sun-2 CPU running Berkley 4.2
In what Sun calls there release 1.1.
-- 
--------------------------
		   Tom Kessler {allegra |seismo }!rochester!ur-laser!tomk
Laboratory for Laser Energetics               Phone: (716)- 275 - 3786
250 East River Road                                         275 - 3194
Rochester, New York 14623



More information about the Comp.lang.c mailing list