In the bash shell, I could echo $? to get the exit code of a program run on the cli. What is the equivalent in the fish shell? Can't seem to find this in the docs.
echo $?
According to the official Fish documentation, you can use the $status variable:
$status
How do I get the exit status of a command? Use the $status variable. This replaces the $? variable used in some other shells.
Use the $status variable. This replaces the $? variable used in some other shells.
$?
1.4m articles
1.4m replys
5 comments
57.0k users