pro* c code: shan.pc
int main()
{
return 8000;
}
shellscript:
#!/bin/ksh
declare -i rc
shan
rc=$?
echo "$rc";
in script I called proc executable i got an output 128, rather then 8000. how can i receive 8000 in shellscript? please help me out?
solution:
int main()
{
count=8000;
prinf("counter %d",count);
return 0;
}
#!/bin/ksh
rc=$(shan | awk '/counter/{print $2}')
echo "$rc";