Helper method for running shell command