I came across a shell script that contains a statement like,
if [ $val -eq $? ]
What does $? mean here?
$?
I found that the link is very useful and is the great answer. It includes clearly expression with sample.