comp.lang.c
c programs & shell conditionals
How is a unix shell script made to respond to the value returned
by a program compiled from c code?
The shell script below is my current effort, which doesn't work.
The c code shows what was used to generate a.out, seen in the shell script.
The value returned was varied from 0 to 1 for testing.
---- shell script
# if [ `/net/u/12/b/br/unet/a.out` 0 ]
if [ `/net/u/12/b/br/unet/a.out` /dev/null ]
then echo "result is positive"
else echo "result is not greater than zero"
fi
--- c program
int main(int argc, char **argv)
{
return 1; /* or return 0 or exit(0) or exit(1) */
}