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.
            Asked
            
        
        
            Active
            
        
            Viewed 2.4k times
        
    1 Answers
88
            According to the official Fish documentation, you can use the $status variable:
How do I get the exit status of a command?
Use the
$statusvariable. This replaces the$?variable used in some other shells.
 
    
    
        Tyler Kindy
        
- 79
- 1
- 7
 
    
    
        user000001
        
- 32,226
- 12
- 81
- 108
 
    