I came across a shell script that contains a statement like,
if [ $val -eq $? ]
What does $? mean here?
$?
returns the status of the last finished command. Status 0 tells you that everything finished ok.
In addition the $ sign is a special symbol - and in that case $val extract the value that is hold by the variable val
$
$val
val