Example:
test.c:
#include <stdio.h>
#include <stdlib.h>
int main (int argc, char **argv)
{
return strtol(argv[1], NULL, 10);
}
test.csh
#!/bin/csh
./a.out $1
set rev=$status
if ( $rev == '0' ) then
echo "a.out returns 0."
else
echo "a.out returns $rev."
endif
沒有留言:
張貼留言