Posted in Command Line, Linux Run a Command if Another Command Succeeds Binny V A December 14, 2007 Leave a Comment on Run a Command if Another Command Succeeds This will let you run a linux command based on the success of anther command. Note: This will only work in bash shell. ruby Create_PDF.rb && if [ $? == 0 ]; then kpdf report.pdf; fi Author: Binny V AA philosopher programmer who specializes in backend development and stoicism.