Unix shell learning detects the Returned code. When running any command, linux returns the response related to the execution of the previous command, called return code. How can we get back to the code? Simple. use $? You can view it. You can view it. If the command is successfully executed, the return code is 0. If the command is not successfully executed, a value other than 0 is returned. We can use a small example in the book to perform a test. The following code writes three different if statements to better learn shell, but their functions are the same. #! /Bin/bashtest-d/usr/local/binif ["$? "-Eq 0] then echo"/usr/local/bin exist! "Else echo"/usr/local/bin does not exist! "Fi # --------------------------------------- if test-d/usr/local/binthen echo"/usr/local/bin exist! "Else echo"/usr/local/bin does not exist! "Fi # ------------------------------------- if [-d/usr/local/bin] then echo"/usr/local/bin exist! "Else echo"/usr/local/bin does not exist! "Fi