tomk@ur-laser.uucp (Tom Kessler) (08/23/84)
#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
mark@gymble.UUCP (08/24/84)
Command and foo are too small. Your lines are longer than 64 chars. Program works fine with larger dimensions.
henry@utzoo.UUCP (Henry Spencer) (08/26/84)
Some of those output lines look longer than 64 characters to me. A size of only 64 for an array which will be used to build a large command is most unwise. -- Henry Spencer @ U of Toronto Zoology {allegra,ihnp4,linus,decvax}!utzoo!henry