Printing the return value using 'echo $?' command
I've recently started using Linux (Ubuntu 8.10). My question is:
I've written a C program that simply returns 5 from main(). When I issue the echo $? command in the terminal, then as expected, it prints 5. But when I enclose the echo $? in a shell script file named ech.sh and then after running the C program, I issue:
It prints 0. ech.sh contains nothing but the echo $? command only.
Can anybody help me please?