I want to run a C program foo.c thats compiled to foo within a bash script and see check if it times out.
There is one parameter to foo and the 10 second timeout. I want to check if the program foo times out or executes. If it times out I want to exit 0.
#!/bin/sh
# -*-sh-*-
/foo $1 10
if [$? -eq 0]
then
exit 0;
fi
exit 1;